Project

General

Profile

Actions

Bug(バグ) #3484

open

opMemberProfileSearchForm 内で定義されていない $values 変数を用いている

Added by Yuya Watanabe about 11 years ago. Updated almost 5 years ago.

Status:
New(新規)
Priority:
Normal(通常)
Assignee:
-
Target version:
Start date:
2013-11-14
Due date:
% Done:

0%

Estimated time:
3.6 で発生するか:
Unknown (未調査)
3.8 で発生するか:
Unknown (未調査)

Description

概要

下記メソッド内で定義されていない $values 変数を用いているため正常に動作しない可能性がある.
影響範囲などについては調査できていない

OpenPNE-3.8.8 コード

lib/form/searchForm/opMemberProfileSearchForm.class.php
 89   protected function addNameColumnQuery(Doctrine_Query $query, $value)
 90   {
 91     if (!empty($value))
 92     {
 93       if (is_array($value))
 94       {
 95         foreach ($value as $v)
 96         {
 97           $query->andWhereLike('name', $v);
 98         }
 99       }
100       else
101       {
102         if (!empty($value))
103         {
104           $query->andWhereLike('name', $values);
105         }
106       }
107     }
108   }

直接影響はしないが !empty($value) の条件が二回行われている.
また is_array() ではなく array でキャストしてしまえば条件分岐はほぼ無くなるのではないかと思う.

Actions #1

Updated by kaoru n almost 5 years ago

  • Target version set to OpenPNE 3.10.x
Actions

Also available in: Atom PDF