Changeset 21442 for branches/version-2_12-dev/data/class/SC_CheckError.php
- Timestamp:
- 2012/02/06 11:27:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_CheckError.php
r21441 r21442 42 42 43 43 function doFunc($value, $arrFunc) { 44 foreach ($arrFunc as $key ) {44 foreach ($arrFunc as $key) { 45 45 $this->$key($value); 46 46 } … … 91 91 } 92 92 $this->createParam($value); 93 if (!is_array($this->arrParam[$value[1]]) && strlen($this->arrParam[$value[1]]) == 0 ) {93 if (!is_array($this->arrParam[$value[1]]) && strlen($this->arrParam[$value[1]]) == 0) { 94 94 $this->arrErr[$value[1]] = "※ " . $value[0] . "が入力されていません。<br />"; 95 95 } else if (is_array($this->arrParam[$value[1]]) && count($this->arrParam[$value[1]]) == 0) { … … 110 110 } 111 111 $this->createParam($value); 112 if (strlen($this->arrParam[$value[0]]) == 0 ) {112 if (strlen($this->arrParam[$value[0]]) == 0) { 113 113 $this->arrErr[$value[0]] = "※ " . $value[0] . "が入力されていません。<br />"; 114 114 } … … 172 172 } 173 173 $this->createParam($value); 174 if (strlen($this->arrParam[$value[1]]) == 0 ) {174 if (strlen($this->arrParam[$value[1]]) == 0) { 175 175 $this->arrErr[$value[1]] = "※ " . $value[0] . "が選択されていません。<br />"; 176 176 } … … 244 244 $this->createParam($value); 245 245 // 文字数の取得 246 if (mb_strlen($this->arrParam[$value[1]]) > $value[2] ) {246 if (mb_strlen($this->arrParam[$value[1]]) > $value[2]) { 247 247 $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "字以下で入力してください。<br />"; 248 248 } … … 262 262 $this->createParam($value); 263 263 // 文字数の取得 264 if (mb_strlen($this->arrParam[$value[1]]) < $value[2] ) {264 if (mb_strlen($this->arrParam[$value[1]]) < $value[2]) { 265 265 $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "字以上で入力してください。<br />"; 266 266 } … … 280 280 $this->createParam($value); 281 281 // 文字数の取得 282 if ($this->arrParam[$value[1]] > $value[2] ) {282 if ($this->arrParam[$value[1]] > $value[2]) { 283 283 $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "以下で入力してください。<br />"; 284 284 } … … 297 297 } 298 298 $this->createParam($value); 299 if ($this->arrParam[$value[1]] < $value[2] ) {299 if ($this->arrParam[$value[1]] < $value[2]) { 300 300 $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "以上で入力してください。<br />"; 301 301 } … … 314 314 } 315 315 $this->createParam($value); 316 if ($this->numelicCheck($this->arrParam[$value[1]]) ) {316 if ($this->numelicCheck($this->arrParam[$value[1]])) { 317 317 $this->arrErr[$value[1]] = "※ " . $value[0] . "は数字で入力してください。<br />"; 318 318 } … … 551 551 } 552 552 $this->createParam($value); 553 if (strlen($this->arrParam[$value[1]]) > 0 && !ctype_alnum($this->arrParam[$value[1]]) ) {553 if (strlen($this->arrParam[$value[1]]) > 0 && !ctype_alnum($this->arrParam[$value[1]])) { 554 554 $this->arrErr[$value[1]] = "※ " . $value[0] . "は英数字で入力してください。<br />"; 555 555 } … … 564 564 } 565 565 $this->createParam($value); 566 if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[[:graph:]|[:space:]]+$/i", $this->arrParam[$value[1]] ) ) {566 if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[[:graph:]|[:space:]]+$/i", $this->arrParam[$value[1]] )) { 567 567 $this->arrErr[$value[1]] = "※ " . $value[0] . "は英数記号で入力してください。<br />"; 568 568 } … … 574 574 function ZERO_CHECK( $value ) { 575 575 $this->createParam($value); 576 if ($this->arrParam[$value[1]] == "0" ) {576 if ($this->arrParam[$value[1]] == "0") { 577 577 $this->arrErr[$value[1]] = "※ " . $value[0] . "は1以上を入力してください。<br />"; 578 578 } … … 589 589 // $this->arrParam[$value[0]] = mb_convert_kana($this->arrParam[$value[0]], 'n'); 590 590 $count = strlen($this->arrParam[$value[1]]); 591 if (( $count > 0 ) && $value[2] > $count || $value[3] < $count ) {591 if (( $count > 0 ) && $value[2] > $count || $value[3] < $count) { 592 592 $this->arrErr[$value[1]] = "※ $value[0]は$value[2]桁~$value[3]桁で入力して下さい。<br />"; 593 593 } … … 603 603 $this->createParam($value); 604 604 $count = strlen($this->arrParam[$value[1]]); 605 if (($count > 0) && $count != $value[2] ) {605 if (($count > 0) && $count != $value[2]) { 606 606 $this->arrErr[$value[1]] = "※ $value[0]は$value[2]桁で入力して下さい。<br />"; 607 607 } … … 671 671 } 672 672 $this->createParam($value); 673 if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[a-zA-Z0-9_\.@\+\?-]+$/i",$this->arrParam[$value[1]]) ) {673 if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[a-zA-Z0-9_\.@\+\?-]+$/i",$this->arrParam[$value[1]])) { 674 674 $this->arrErr[$value[1]] = "※ " . $value[0] . "に使用する文字を正しく入力してください。<br />"; 675 675 } … … 683 683 return; 684 684 } 685 if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("@^https?://+($|[a-zA-Z0-9_~=:&\?\.\/-])+$@i", $this->arrParam[$value[1]] ) ) {685 if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("@^https?://+($|[a-zA-Z0-9_~=:&\?\.\/-])+$@i", $this->arrParam[$value[1]] )) { 686 686 $this->arrErr[$value[1]] = "※ " . $value[0] . "を正しく入力してください。<br />"; 687 687 } … … 719 719 $this->createParam($value); 720 720 721 if ($_FILES[$value[1]]['name'] != "" ) {721 if ($_FILES[$value[1]]['name'] != "") { 722 722 $errFlag = 1; 723 723 $array_ext = explode(".", $_FILES[$value[1]]['name']); … … 725 725 $strExt = ""; 726 726 727 foreach ($value[2] as $checkExt ) {727 foreach ($value[2] as $checkExt) { 728 728 $ext = ""; 729 729 … … 802 802 } 803 803 $this->createParam($value); 804 if ($_FILES[$value[1]]['size'] > $value[2] * 1024 ) {804 if ($_FILES[$value[1]]['size'] > $value[2] * 1024) { 805 805 $byte = 'KB'; 806 if ($value[2] >= 1000 ) {806 if ($value[2] >= 1000) { 807 807 $value[2] = $value[2] / 1000; 808 808 $byte = 'MB'; … … 820 820 } 821 821 $this->createParam($value); 822 if (strlen($_FILES[$value[1]]['name']) > 0 && !preg_match("/^[[:alnum:]_\.-]+$/i", $_FILES[$value[1]]['name']) ) {822 if (strlen($_FILES[$value[1]]['name']) > 0 && !preg_match("/^[[:alnum:]_\.-]+$/i", $_FILES[$value[1]]['name'])) { 823 823 $this->arrErr[$value[1]] = "※ " . $value[0] . "のファイル名に日本語やスペースは使用しないで下さい。<br />"; 824 824 } … … 960 960 $this->createParam($value); 961 961 $error = 0; 962 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]]) ) {962 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]])) { 963 963 $this->arrErr[$value[2]] = "※ " . $value[0] . "を正しく指定してください。<br />"; 964 964 } 965 if ((strlen($this->arrParam[$value[5]]) > 0 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0) && ! checkdate($this->arrParam[$value[6]], $this->arrParam[$value[7]], $this->arrParam[$value[5]]) ) {965 if ((strlen($this->arrParam[$value[5]]) > 0 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0) && ! checkdate($this->arrParam[$value[6]], $this->arrParam[$value[7]], $this->arrParam[$value[5]])) { 966 966 $this->arrErr[$value[5]] = "※ " . $value[1] . "を正しく指定してください。<br />"; 967 967 } 968 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 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0) ) {968 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 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0)) { 969 969 970 970 $date1 = $this->arrParam[$value[2]] .sprintf("%02d", $this->arrParam[$value[3]]) .sprintf("%02d",$this->arrParam[$value[4]]) ."000000"; … … 1011 1011 $this->createParam($value); 1012 1012 $error = 0; 1013 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]]) ) {1013 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]])) { 1014 1014 $this->arrErr[$value[2]] = "※ " . $value[0] . "を正しく指定してください。<br />"; 1015 1015 } 1016 if ((strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0) && ! checkdate($this->arrParam[$value[9]], $this->arrParam[$value[10]], $this->arrParam[$value[8]]) ) {1016 if ((strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0) && ! checkdate($this->arrParam[$value[9]], $this->arrParam[$value[10]], $this->arrParam[$value[8]])) { 1017 1017 $this->arrErr[$value[8]] = "※ " . $value[1] . "を正しく指定してください。<br />"; 1018 1018 } 1019 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) && (strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0) ) {1019 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) && (strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0)) { 1020 1020 1021 1021 $date1 = $this->arrParam[$value[2]] .sprintf("%02d", $this->arrParam[$value[3]]) .sprintf("%02d",$this->arrParam[$value[4]]) .sprintf("%02d",$this->arrParam[$value[5]]).sprintf("%02d",$this->arrParam[$value[6]]).sprintf("%02d",$this->arrParam[$value[7]]); … … 1055 1055 $this->createParam($value); 1056 1056 $error = 0; 1057 if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]]) ) {1057 if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]])) { 1058 1058 $this->arrErr[$value[2]] = "※ " . $value[0] . "を正しく指定してください。<br />"; 1059 1059 } 1060 if ((strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[5]], 1, $this->arrParam[$value[4]]) ) {1060 if ((strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[5]], 1, $this->arrParam[$value[4]])) { 1061 1061 $this->arrErr[$value[4]] = "※ " . $value[1] . "を正しく指定してください。<br />"; 1062 1062 } … … 1142 1142 */ 1143 1143 function PROHIBITED_STR_CHECK( $value ) { 1144 if (isset($this->arrErr[$value[1]]) || empty($this->arrParam[$value[1]]) ) {1144 if (isset($this->arrErr[$value[1]]) || empty($this->arrParam[$value[1]])) { 1145 1145 return; 1146 1146 }
Note: See TracChangeset
for help on using the changeset viewer.
