Changeset 21586 for branches/version-2_12-dev/data/class/SC_CheckError.php
- Timestamp:
- 2012/03/04 16:34:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_CheckError.php
r21578 r21586 719 719 $this->createParam($value); 720 720 721 if ($_FILES[$value[1]]['name'] != '') { 722 $errFlag = 1; 723 $array_ext = explode('.', $_FILES[$value[1]]['name']); 724 725 $strExt = ''; 726 727 foreach ($value[2] as $checkExt) { 728 $ext = ''; 729 730 // チェック拡張子のピリオドの数を取得('tar.gz'の場合1個、'jpg'のように通常は0個) 731 $count_period = substr_count($checkExt, '.'); 732 733 if ($count_period > 0) { 734 for ($i = max(array_keys($array_ext)) - $count_period; $i < count($array_ext); $i++) { 735 $ext .= $array_ext[$i] . '.'; 736 } 737 $ext = preg_replace("/.$/", "" ,$ext); 738 } else { 739 $ext = $array_ext[ count ($array_ext) - 1 ]; 721 $match = false; 722 if (strlen($_FILES[$value[1]]['name']) >= 1) { 723 $filename = $_FILES[$value[1]]['name']; 724 725 foreach ($value[2] as $check_ext) { 726 $match = preg_match('/' . preg_quote('.' . $check_ext) . '$/i', $filename) >= 1; 727 if ($match === true) { 728 break 1; 740 729 } 741 742 $ext = strtolower($ext); 743 744 if ($ext == $checkExt) { 745 $errFlag = 0; 746 } 747 748 if ($strExt == '') { 749 $strExt.= $checkExt; 750 } else { 751 $strExt.= "・$checkExt"; 752 } 753 } 754 } 755 if ($errFlag == 1) { 756 $this->arrErr[$value[1]] = '※ ' . $value[0] . 'で許可されている形式は、' . $strExt . 'です。<br />'; 730 } 731 } 732 if ($match === false) { 733 $str_ext = implode('・', $value[2]); 734 $this->arrErr[$value[1]] = '※ ' . $value[0] . 'で許可されている形式は、' . $str_ext . 'です。<br />'; 757 735 } 758 736 }
Note: See TracChangeset
for help on using the changeset viewer.
