Changeset 22891


Ignore:
Timestamp:
2013/06/25 15:11:17 (11 years ago)
Author:
m_uehara
Message:

#2277 入力チェック処理修正

Location:
branches/version-2_12-dev/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_CheckError.php

    r22876 r22891  
    104104            return; 
    105105        } 
    106         $this->createParam($value); 
     106        // $this->createParam($value); 
    107107        if (strlen($this->arrParam[$value[0]]) == 0) { 
    108108            $this->arrErr[$value[0]] = '※ ' . $value[0] . 'が入力されていません。<br />'; 
     
    183183            return; 
    184184        } 
    185         $this->createParam($value); 
     185        // $this->createParam($value); 
    186186        // 文字数の取得 
    187187        if ($this->arrParam[$value[2]] !== $this->arrParam[$value[3]]) { 
     
    201201            return; 
    202202        } 
    203         $this->createParam($value); 
     203        // $this->createParam($value); 
    204204        // 文字数の取得 
    205205        if ($this->arrParam[$value[2]] == $this->arrParam[$value[3]]) { 
     
    219219            return; 
    220220        } 
    221         $this->createParam($value); 
     221        // $this->createParam($value); 
    222222        // 文字数の取得 
    223223        if ($this->arrParam[$value[2]] != '' && $this->arrParam[$value[3]] != '' && ($this->arrParam[$value[2]] > $this->arrParam[$value[3]])) { 
     
    930930            return; 
    931931        } 
    932         $this->createParam($value); 
     932        // $this->createParam($value); 
    933933        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 
    934934            $this->arrErr[$value[2]] = '※ ' . $value[0] . 'を正しく指定してください。<br />'; 
     
    980980            return; 
    981981        } 
    982         $this->createParam($value); 
     982        // $this->createParam($value); 
    983983        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 
    984984            $this->arrErr[$value[2]] = '※ ' . $value[0] . 'を正しく指定してください。<br />'; 
     
    10231023            return; 
    10241024        } 
    1025         $this->createParam($value); 
     1025        // $this->createParam($value); 
    10261026        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]])) { 
    10271027            $this->arrErr[$value[2]] = '※ ' . $value[0] . 'を正しく指定してください。<br />'; 
     
    11351135            return; 
    11361136        } 
    1137         $this->createParam($value); 
     1137        // $this->createParam($value); 
    11381138        if ($this->evalCheck($value[1]) === false) { 
    11391139            $this->arrErr[$value[0]] = '※ ' . $value[0] . ' の形式が不正です。<br />'; 
     
    11641164     */ 
    11651165    function createParam($value) { 
    1166         foreach ($value as $key) { 
    1167             if (is_string($key) || is_int($key)) { 
    1168                 if (!isset($this->arrParam[$key]))  $this->arrParam[$key] = ''; 
    1169             } 
    1170         } 
     1166         foreach ($value as $val_key => $key) { 
     1167             if ($val_key != 0 && (is_string($key) || is_int($key))) { 
     1168                 if (!is_numeric($key) && preg_match('/^[a-z0-9_]+$/i', $key)) { 
     1169                     if (!isset($this->arrParam[$key])) $this->arrParam[$key] = ''; 
     1170                     if (strlen($this->arrParam[$key]) > 0 
     1171                           && (preg_match('/^[[:alnum:]\-\_]*[\.\/\\\\]*\.\.(\/|\\\\)/',$this->arrParam[$key]) || !preg_match('/\A[^\x00-\x08\x0b\x0c\x0e-\x1f\x7f]+\z/u', $this->arrParam[$key]))) 
     1172                           ) { 
     1173                         $this->arrErr[$value[1]] = '※ ' . $value[0] . 'に禁止された記号の並びまたは制御文字が入っています。<br />'; 
     1174                     } 
     1175                 } else if (preg_match('/[^a-z0-9_]/i', $key)) { 
     1176                     trigger_error('', E_USER_ERROR); 
     1177                 } 
     1178             } 
     1179         } 
    11711180    } 
    11721181 
  • branches/version-2_12-dev/data/class/SC_FormParam.php

    r22796 r22891  
    277277            } 
    278278        } else { 
    279             $objErr = new SC_CheckError_Ex(array(0 => $value)); 
    280             $objErr->doFunc(array($disp_name, 0, $length), array($func)); 
     279            $objErr = new SC_CheckError_Ex(array(($error_last_key ? $error_last_key : $error_key) => $value)); 
     280            $objErr->doFunc(array($disp_name, ($error_last_key ? $error_last_key : $error_key), $length), array($func)); 
    281281            if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { 
    282282                foreach ($objErr->arrErr as $message) { 
Note: See TracChangeset for help on using the changeset viewer.