- Timestamp:
- 2007/09/07 14:45:56 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/SC_CheckError.php
r15532 r15641 37 37 return; 38 38 } 39 39 $this->createParam($value); 40 40 // 含まれているタグを抽出する 41 41 preg_match_all("/<([\/]?[a-z]+)/", $this->arrParam[$value[1]], $arrTag); … … 64 64 return; 65 65 } 66 $this->createParam($value); 66 67 if( strlen($this->arrParam[$value[1]]) == 0 ){ 67 68 $this->arrErr[$value[1]] = "※ " . $value[0] . "が入力されていません。<br />"; … … 75 76 return; 76 77 } 77 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";78 $this->createParam($value); 78 79 if(strlen($this->arrParam[$value[1]]) != 0 && ereg("^[ \t\r\n]+$", $this->arrParam[$value[1]])){ 79 80 $this->arrErr[$value[1]] = "※ " . $value[0] . "にスペース、タブ、改行のみの入力はできません。<br />"; … … 87 88 return; 88 89 } 89 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";90 $this->createParam($value); 90 91 if(strlen($this->arrParam[$value[1]]) != 0 && mb_ereg("[ \t\r\n]+", $this->arrParam[$value[1]])){ 91 92 $this->arrErr[$value[1]] = "※ " . $value[0] . "にスペース、タブ、改行は含めないで下さい。<br />"; … … 98 99 return; 99 100 } 100 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";101 $this->createParam($value); 101 102 if(strlen($this->arrParam[$value[1]]) != 0 && ereg("^[0]+[0-9]+$", $this->arrParam[$value[1]])){ 102 103 $this->arrErr[$value[1]] = "※ " . $value[0] . "に0で始まる数値が入力されています。<br />"; … … 110 111 return; 111 112 } 112 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";113 $this->createParam($value); 113 114 if( strlen($this->arrParam[$value[1]]) == 0 ){ 114 115 $this->arrErr[$value[1]] = "※ " . $value[0] . "が選択されていません。<br />"; … … 122 123 return; 123 124 } 124 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";125 $this->createParam($value); 125 126 // 文字数の取得 126 127 if( $this->arrParam[$value[2]] != $this->arrParam[$value[3]]) { … … 135 136 return; 136 137 } 137 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";138 $this->createParam($value); 138 139 // 文字数の取得 139 140 if( $this->arrParam[$value[2]] == $this->arrParam[$value[3]]) { … … 148 149 return; 149 150 } 150 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";151 $this->createParam($value); 151 152 // 文字数の取得 152 153 if($this->arrParam[$value[2]] != "" && $this->arrParam[$value[3]] != "" && ($this->arrParam[$value[2]] > $this->arrParam[$value[3]])) { … … 162 163 return; 163 164 } 164 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";165 $this->createParam($value); 165 166 // 文字数の取得 166 167 if( mb_strlen($this->arrParam[$value[1]]) > $value[2] ) { … … 175 176 return; 176 177 } 177 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";178 $this->createParam($value); 178 179 // 文字数の取得 179 180 if( mb_strlen($this->arrParam[$value[1]]) < $value[2] ) { … … 188 189 return; 189 190 } 190 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";191 $this->createParam($value); 191 192 // 文字数の取得 192 193 if($this->arrParam[$value[1]] > $value[2] ) { … … 201 202 return; 202 203 } 203 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";204 $this->createParam($value); 204 205 if($this->arrParam[$value[1]] < $value[2] ) { 205 206 $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "以上で入力してください。<br />"; … … 214 215 return; 215 216 } 216 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";217 $this->createParam($value); 217 218 if( strlen($this->arrParam[$value[1]]) > 0 && !EregI("^[[:digit:]]+$", $this->arrParam[$value[1]])) { 218 219 $this->arrErr[$value[1]] = "※ " . $value[0] . "は数字で入力してください。<br />"; … … 226 227 return; 227 228 } 228 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";229 $this->createParam($value); 229 230 if( strlen($this->arrParam[$value[1]]) > 0 && !EregI("^[[:digit:]]+[\.]?[[:digit:]]+$", $this->arrParam[$value[1]])) { 230 231 $this->arrErr[$value[1]] = "※ " . $value[0] . "は数字で入力してください。<br />"; … … 236 237 return; 237 238 } 238 if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = "";239 $this->createParam($value); 239 240 if( strlen($this->arrParam[$value[1]]) > 0 && !EregI("^[[:alpha:]]+$", $this->arrParam[$value[1]])) { 240 241 $this->arrErr[$value[1]] = "※ " . $value[0] . "は半角英字で入力してください。<br />"; … … 253 254 return; 254 255 } 255 256 $this->createParam($value); 256 257 $cnt = 0; 257 258 … … 282 283 function FULL_EXIST_CHECK($value) { 283 284 $max = count($value); 284 285 $this->createParam($value); 285 286 // 既に該当項目にエラーがある場合は、判定しない。 286 287 for($i = 1; $i < $max; $i++) { … … 341 342 function ONE_EXIST_CHECK($value) { 342 343 $max = count($value); 343 344 $this->createParam($value); 344 345 // 既に該当項目にエラーがある場合は、判定しない。 345 346 for($i = 1; $i < $max; $i++) { … … 369 370 function TOP_EXIST_CHECK($value) { 370 371 $max = count($value); 372 $this->createParam($value); 371 373 372 374 // 既に該当項目にエラーがある場合は、判定しない。 … … 403 405 return; 404 406 } 407 $this->createParam($value); 405 408 if(strlen($this->arrParam[$value[1]]) > 0 && ! mb_ereg("^[ァ-ヶヲ-゚ー]+$", $this->arrParam[$value[1]])) { 406 409 $this->arrErr[$value[1]] = "※ " . $value[0] . "はカタカナで入力してください。<br />"; … … 414 417 return; 415 418 } 419 $this->createParam($value); 416 420 if(strlen($this->arrParam[$value[1]]) > 0 && ! mb_ereg("^([ \t\r\n]|[ァ-ヶ]|[ー])+$", $this->arrParam[$value[1]])) { 417 421 $this->arrErr[$value[1]] = "※ " . $value[0] . "はカタカナで入力してください。<br />"; … … 425 429 return; 426 430 } 431 $this->createParam($value); 427 432 if( strlen($this->arrParam[$value[1]]) > 0 && ! EregI("^[[:alnum:]]+$", $this->arrParam[$value[1]] ) ) { 428 433 $this->arrErr[$value[1]] = "※ " . $value[0] . "は英数字で入力してください。<br />"; … … 433 438 // value[0] = 項目名 value[1] = 判定対象 434 439 function ZERO_CHECK( $value ) { // 入力値で0が許されない場合エラーを返す 435 440 $this->createParam($value); 436 441 if($this->arrParam[$value[1]] == "0" ){ 437 442 $this->arrErr[$value[1]] = "※ " . $value[0] . "は1以上を入力してください。<br />"; … … 445 450 return; 446 451 } 452 $this->createParam($value); 447 453 // $this->arrParam[$value[0]] = mb_convert_kana($this->arrParam[$value[0]], "n"); 448 454 $count = strlen($this->arrParam[$value[1]]); … … 458 464 return; 459 465 } 466 $this->createParam($value); 460 467 $count = strlen($this->arrParam[$value[1]]); 461 468 if(($count > 0) && $count != $value[2] ) { … … 470 477 return; 471 478 } 479 $this->createParam($value); 472 480 if(strlen($this->arrParam[$value[1]]) > 0 && !ereg("^[^@]+@[^.]+\..+", $this->arrParam[$value[1]])) { 473 481 $this->arrErr[$value[1]] = "※ " . $value[0] . "の形式が不正です。<br />"; … … 481 489 return; 482 490 } 491 $this->createParam($value); 483 492 if(strlen($this->arrParam[$value[1]]) > 0 && !ereg("^[a-zA-Z0-9_\.@\+\?-]+$",$this->arrParam[$value[1]]) ) { 484 493 $this->arrErr[$value[1]] = "※ " . $value[0] . "に使用する文字を正しく入力してください。<br />"; … … 503 512 return; 504 513 } 514 $this->createParam($value); 505 515 506 516 if($_FILES[$value[1]]['name'] != "" ) { … … 536 546 } 537 547 548 $this->createParam($value); 538 549 if($value[2] != "") { 539 550 $dir = $value[2]; … … 556 567 return; 557 568 } 569 $this->createParam($value); 558 570 if(!($_FILES[$value[1]]['size'] != "" && $_FILES[$value[1]]['size'] > 0)){ 559 571 $this->arrErr[$value[1]] = "※ " . $value[0] . "をアップロードして下さい。<br />"; … … 567 579 return; 568 580 } 581 $this->createParam($value); 569 582 if( $_FILES[$value[1]]['size'] > $value[2] * 1024 ){ 570 583 $byte = "KB"; … … 583 596 return; 584 597 } 598 $this->createParam($value); 585 599 if( strlen($_FILES[$value[1]]['name']) > 0 && ! EregI("^[[:alnum:]_\.-]+$", $_FILES[$value[1]]['name']) ) { 586 600 $this->arrErr[$value[1]] = "※ " . $value[0] . "のファイル名に日本語やスペースは使用しないで下さい。<br />"; … … 594 608 return; 595 609 } 596 610 $this->createParam($value); 597 611 if( strlen($this->arrParam[$value[1]]) > 0 && ! EregI("^[[:alnum:]_\.-]+$", $this->arrParam[$value[1]]) || EregI("[\\]" ,$this->arrParam[$value[1]])) { 598 612 $this->arrErr[$value[1]] = "※ " . $value[0] . "のファイル名に日本語やスペースは使用しないで下さい。<br />"; … … 609 623 return; 610 624 } 625 $this->createParam($value); 611 626 // 少なくともどれか一つが入力されている。 612 627 if($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0 || $this->arrParam[$value[3]] > 0) { … … 631 646 return; 632 647 } 633 648 $this->createParam($value); 634 649 // 少なくともどれか一つが入力されている。 635 650 if($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0 || $this->arrParam[$value[3]] > 0 || $this->arrParam[$value[4]] >= 0 || $this->arrParam[$value[5]] >= 0) { … … 651 666 return; 652 667 } 653 668 $this->createParam($value); 654 669 // 少なくともどれか一つが入力されている。 655 670 if($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0) { … … 686 701 return; 687 702 } 703 $this->createParam($value); 688 704 $error = 0; 689 705 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]]) ) { … … 736 752 return; 737 753 } 754 $this->createParam($value); 738 755 $error = 0; 739 756 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]]) ) { … … 779 796 return; 780 797 } 798 $this->createParam($value); 781 799 $error = 0; 782 800 if ( (strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]]) ) { … … 802 820 return; 803 821 } 822 $this->createParam($value); 804 823 if(!is_dir($this->arrParam[$value[1]])) { 805 824 $this->arrErr[$value[1]] = "※ 指定した" . $value[0] . "は存在しません。<br />"; … … 823 842 return; 824 843 } 844 $this->createParam($value); 825 845 if(strlen($this->arrParam[$value[1]]) > 0 && !gfIsMobileMailAddress($this->arrParam[$value[1]])) { 826 846 $this->arrErr[$value[1]] = "※ " . $value[0] . "は携帯電話のものではありません。<br />"; … … 838 858 return; 839 859 } 840 860 $this->createParam($value); 841 861 $targetStr = $this->arrParam[$value[1]]; 842 862 $prohibitedStr = str_replace(array('|', '/'), array('\|', '\/'), $value[2]); … … 847 867 } 848 868 } 869 870 /** 871 * 未定義の $this->arrParam に空要素を代入する. 872 * 873 * @access private 874 * @param array $value 配列 875 * @return void 876 */ 877 function createParam($value) { 878 foreach ($value as $key) { 879 if (!isset($this->arrParam[$key])) $this->arrParam[$key] = ""; 880 } 881 } 849 882 } 850 883 ?>
Note: See TracChangeset
for help on using the changeset viewer.