Changeset 21755
- Timestamp:
- 2012/04/17 15:53:10 (12 years ago)
- Location:
- branches/version-2_12-dev/data/class
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_CustomerList.php
r21608 r21755 85 85 $this->setWhere('(' . $dbFactory->concatColumn(array('tel01', 'tel02', 'tel03')) . ' LIKE ?)'); 86 86 $searchTel = $this->addSearchStr($this->arrSql['search_tel']); 87 $this->arrVal[] = ereg_replace('-', '', $searchTel);87 $this->arrVal[] = str_replace('-', '', $searchTel); 88 88 } 89 89 -
branches/version-2_12-dev/data/class/SC_Image.php
r21526 r21755 29 29 function SC_Image($tmp_dir) { 30 30 // ヘッダファイル読込 31 if (!ereg("/$", $tmp_dir)) { 32 $this->tmp_dir = $tmp_dir . '/'; 33 } else { 34 $this->tmp_dir = $tmp_dir; 35 } 31 $this->tmp_dir = rtrim($tmp_dir, '/') . '/'; 36 32 } 37 33 … … 41 37 $mainname = uniqid('').'.'; 42 38 // 拡張子以外を置き換える。 43 $newFileName = ereg_replace("^.*\.",$mainname, $_FILES[$keyname]['name']);39 $newFileName = preg_replace("/^.*\./", $mainname, $_FILES[$keyname]['name']); 44 40 $result = $this->MakeThumb($_FILES[$keyname]['tmp_name'], $this->tmp_dir , $max_width, $max_height, $newFileName); 45 41 GC_Utils_Ex::gfDebugLog($result); -
branches/version-2_12-dev/data/class/SC_UploadFile.php
r21684 r21755 59 59 // ファイル管理クラス 60 60 function SC_UploadFile($temp_dir, $save_dir) { 61 $this->temp_dir = (preg_match("|/$|", $temp_dir) == 0) ? $temp_dir. '/' : $temp_dir;62 $this->save_dir = (preg_match("|/$|", $save_dir) == 0) ? $save_dir. '/' : $save_dir;61 $this->temp_dir = rtrim($temp_dir, '/') . '/'; 62 $this->save_dir = rtrim($save_dir, '/') . '/'; 63 63 $this->file_max = 0; 64 64 } … … 117 117 if ($rename) { 118 118 $uniqname = date('mdHi') . '_' . uniqid('').'.'; 119 $this->temp_file[$cnt] = ereg_replace("^.*\.",$uniqname, $_FILES[$keyname]['name']);119 $this->temp_file[$cnt] = preg_replace("/^.*\./", $uniqname, $_FILES[$keyname]['name']); 120 120 } else { 121 121 $this->temp_file[$cnt] = $_FILES[$keyname]['name']; … … 155 155 // 一意なファイル名を作成する。 156 156 $uniqname = date('mdHi') . '_' . uniqid('').'.'; 157 $this->temp_file[$cnt] = ereg_replace("^.*\.",$uniqname, $_FILES[$keyname]['name']);157 $this->temp_file[$cnt] = preg_replace("/^.*\./", $uniqname, $_FILES[$keyname]['name']); 158 158 set_time_limit(0); 159 159 $result = copy($_FILES[$keyname]['tmp_name'], $this->temp_dir . $this->temp_file[$cnt]); … … 229 229 if (isset($this->save_file[$cnt]) 230 230 && $this->save_file[$cnt] != '' 231 && ! ereg('^sub/', $this->save_file[$cnt])231 && !preg_match('|^sub/|', $this->save_file[$cnt]) 232 232 ) { 233 233 … … 249 249 if (isset($this->save_file[$cnt]) 250 250 && $this->save_file[$cnt] != '' 251 && ! ereg('^sub/', $this->save_file[$cnt])251 && !preg_match('|^sub/|', $this->save_file[$cnt]) 252 252 ) { 253 253 $objImage->deleteImage($this->save_file[$cnt], $this->save_dir); … … 311 311 foreach ($this->keyname as $val) { 312 312 if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 313 // ファイルパスチェック(パスのスラッシュ/が連続しないようにする。) 314 if (ereg("/$", $temp_url)) { 315 $arrRet[$val]['filepath'] = $temp_url . $this->temp_file[$cnt]; 316 } else { 317 $arrRet[$val]['filepath'] = $temp_url . '/' . $this->temp_file[$cnt]; 318 } 313 // パスのスラッシュ/が連続しないようにする。 314 $arrRet[$val]['filepath'] = rtrim($temp_url, '/') . '/' . $this->temp_file[$cnt]; 315 319 316 $arrRet[$val]['real_filepath'] = $this->temp_dir . $this->temp_file[$cnt]; 320 317 } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') { 321 // ファイルパスチェック(パスのスラッシュ/が連続しないようにする。) 322 if (ereg("/$", $save_url)) { 323 $arrRet[$val]['filepath'] = $save_url . $this->save_file[$cnt]; 324 } else { 325 $arrRet[$val]['filepath'] = $save_url . '/' . $this->save_file[$cnt]; 326 } 318 // パスのスラッシュ/が連続しないようにする。 319 $arrRet[$val]['filepath'] = rtrim($save_url, '/') . '/' . $this->save_file[$cnt]; 320 327 321 $arrRet[$val]['real_filepath'] = $this->save_dir . $this->save_file[$cnt]; 328 322 } … … 438 432 foreach ($this->keyname as $val) { 439 433 if ($arrVal[$val] != '') { 440 if ($this->save_file[$cnt] == '' && ! ereg('^sub/', $arrVal[$val])) {434 if ($this->save_file[$cnt] == '' && !preg_match('|^sub/|', $arrVal[$val])) { 441 435 $objImage->deleteImage($arrVal[$val], $this->save_dir); 442 436 } … … 451 445 $cnt = 0; 452 446 if ($arrVal['down_realfilename'] != '') { 453 if ($this->save_file[$cnt] == '' && ! ereg('^sub/', $arrVal['down_realfilename'])) {447 if ($this->save_file[$cnt] == '' && !preg_match('|^sub/|', $arrVal['down_realfilename'])) { 454 448 $objImage->deleteImage($arrVal['down_realfilename'], $this->save_dir); 455 449 } -
branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php
r21684 r21755 46 46 // 行末の/を取り除く 47 47 while (($file = readdir($dh)) !== false) $arrDir[] = $file; 48 $dir = ereg_replace("/$", '', $dir);48 $dir = rtrim($dir, '/'); 49 49 // アルファベットと数字でソート 50 50 natcasesort($arrDir); … … 98 98 while ($file = readdir($handle)) { 99 99 // 行末の/を取り除く 100 $dir = ereg_replace("/$", '', $dir);100 $dir = rtrim($dir, '/'); 101 101 $path = $dir.'/'.$file; 102 102 if ($file != '..' && $file != '.' && !is_dir($path)) { … … 173 173 174 174 // 文末の/を取り除く 175 $dir = ereg_replace("/$", '', $dir);175 $dir = rtrim($dir, '/'); 176 176 // 最上位層を格納(user_data/) 177 177 if ($this->sfDirChildExists($dir)) { … … 217 217 if ($item != '.' && $item != '..') { 218 218 // 文末の/を取り除く 219 $dir = ereg_replace("/$", '', $dir);219 $dir = rtrim($dir, '/'); 220 220 $path = $dir.'/'.$item; 221 221 // ディレクトリのみ取得 … … 258 258 while ($file = readdir($handle)) { 259 259 // 行末の/を取り除く 260 $dir = ereg_replace("/$", '', $dir);260 $dir = rtrim($dir, '/'); 261 261 $path = $dir.'/'.$file; 262 262 if ($file != '..' && $file != '.' && is_dir($path)) { -
branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php
r21743 r21755 109 109 if (SC_Utils_Ex::isBlank($this->arrErr)) { 110 110 if ($this->tryView($objFormParam)) { 111 $file_url = htmlspecialchars(ereg_replace($objFormParam->getValue('top_dir'), '', $objFormParam->getValue('select_file'))); 111 $pattern = '/' . preg_quote($objFormParam->getValue('top_dir'), '/') . '/'; 112 $file_url = htmlspecialchars(preg_replace($pattern, '', $objFormParam->getValue('select_file'))); 112 113 $tpl_onload = "win02('./file_view.php?file=". $file_url ."', 'user_data', '600', '400');"; 113 114 $this->setTplOnLoad($tpl_onload); … … 317 318 function tryCreateDir($objFileManager, $objFormParam) { 318 319 $create_dir_flg = false; 319 $create_dir = ereg_replace("/$", '', $objFormParam->getValue('now_dir'));320 $create_dir = rtrim($objFormParam->getValue('now_dir'), '/'); 320 321 // ファイル作成 321 322 if ($objFileManager->sfCreateFile($create_dir.'/'.$objFormParam->getValue('create_file'), 0755)) { … … 425 426 function lfGetParentDir($dir) { 426 427 $parent_dir = ''; 427 $dir = ereg_replace("/$", '', $dir);428 $dir = rtrim($dir, '/'); 428 429 $arrDir = explode('/', $dir); 429 430 array_pop($arrDir); … … 431 432 $parent_dir .= "$val/"; 432 433 } 433 $parent_dir = ereg_replace("/$", '', $parent_dir);434 $parent_dir = rtrim($parent_dir, '/'); 434 435 return $parent_dir; 435 436 } … … 478 479 $is_top_dir = false; 479 480 // 末尾の/をとる 480 $top_dir_check = ereg_replace("/$", '', $objFormParam->getValue('top_dir'));481 $now_dir_check = ereg_replace("/$", '', $objFormParam->getValue('now_dir'));481 $top_dir_check = rtrim($objFormParam->getValue('top_dir'), '/'); 482 $now_dir_check = rtrim($objFormParam->getValue('now_dir'), '/'); 482 483 if ($top_dir_check == $now_dir_check) { 483 484 $is_top_dir = true; -
branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php
r21743 r21755 417 417 418 418 foreach (array_keys($arrList) as $val) { 419 $arrKey[] = ereg_replace('~', '-', $val);419 $arrKey[] = mb_ereg_replace('~', '-', $val); 420 420 } 421 421 -
branches/version-2_12-dev/data/class/util/SC_Utils.php
r21750 r21755 503 503 } 504 504 if ($space) { 505 $line = ereg_replace(", $", '', $line);505 $line = preg_replace("/, $/", '', $line); 506 506 } else { 507 $line = ereg_replace(",$", '', $line);507 $line = preg_replace("/,$/", '', $line); 508 508 } 509 509 return $line; … … 522 522 $line .= '"' .$val. '",'; 523 523 } 524 $line = ereg_replace(",$", "\r\n", $line);524 $line = preg_replace("/,$/", "\r\n", $line); 525 525 } else { 526 526 return false; … … 714 714 /* 文末の「/」をなくす */ 715 715 function sfTrimURL($url) { 716 $ret = ereg_replace("[/]+$", '', $url);716 $ret = rtrim($url, '/'); 717 717 return $ret; 718 718 } … … 813 813 // 二回以上繰り返されているスラッシュ[/]を一つに変換する。 814 814 function sfRmDupSlash($istr) { 815 if ( ereg('^http://', $istr)) {815 if (preg_match('|^http://|', $istr)) { 816 816 $str = substr($istr, 7); 817 817 $head = 'http://'; 818 } else if ( ereg('^https://', $istr)) {818 } else if (preg_match('|^https://|', $istr)) { 819 819 $str = substr($istr, 8); 820 820 $head = 'https://'; … … 822 822 $str = $istr; 823 823 } 824 $str = ereg_replace('[/]+', '/', $str);824 $str = preg_replace('|[/]+|', '/', $str); 825 825 $ret = $head . $str; 826 826 return $ret; … … 985 985 // DB取得日時をタイムに変換 986 986 function sfDBDatetoTime($db_date) { 987 $date = ereg_replace("\..*$",'',$db_date);987 $date = preg_replace("|\..*$|",'',$db_date); 988 988 $time = strtotime($date); 989 989 return $time; … … 1076 1076 $count++; // 無限ループ回避 1077 1077 $dir = dirname($path); 1078 if ( ereg("^[/]$", $dir) || ereg("^[A-Z]:[\\]$", $dir) || $count > 256) {1078 if (preg_match("|^[/]$|", $dir) || preg_match("|^[A-Z]:[\\]$|", $dir) || $count > 256) { 1079 1079 // ルートディレクトリで終了 1080 1080 return; … … 1118 1118 foreach ($fileArray as $key => $data_) { 1119 1119 // CVS管理ファイルはコピーしない 1120 if ( ereg('/CVS/Entries', $data_)) {1120 if (strpos($data_, '/CVS/Entries') !== false) { 1121 1121 break; 1122 1122 } 1123 if ( ereg('/CVS/Repository', $data_)) {1123 if (strpos($data_, '/CVS/Repository') !== false) { 1124 1124 break; 1125 1125 } 1126 if ( ereg('/CVS/Root', $data_)) {1126 if (strpos($data_, '/CVS/Root') !== false) { 1127 1127 break; 1128 1128 } … … 1242 1242 while (!feof($src_fp)) { 1243 1243 $line = fgets($src_fp); 1244 if ( ereg('@version', $line)) {1244 if (strpos($line, '@version') !== false) { 1245 1245 $arrLine = explode(' ', $line); 1246 1246 $version = $arrLine[5]; … … 1325 1325 // 行末の/を取り除く 1326 1326 while (($file = readdir($dh)) !== false) $arrDir[] = $file; 1327 $dir = ereg_replace("/$", '', $dir);1327 $dir = rtrim($dir, '/'); 1328 1328 // アルファベットと数字でソート 1329 1329 natcasesort($arrDir); … … 1375 1375 while ($file = readdir($handle)) { 1376 1376 // 行末の/を取り除く 1377 $dir = ereg_replace("/$", '', $dir);1377 $dir = rtrim($dir, '/'); 1378 1378 $path = $dir.'/'.$file; 1379 1379 if ($file != '..' && $file != '.' && !is_dir($path)) { … … 1410 1410 1411 1411 // 文末の/を取り除く 1412 $dir = ereg_replace("/$", '', $dir);1412 $dir = rtrim($dir, '/'); 1413 1413 // 最上位層を格納(user_data/) 1414 1414 if (sfDirChildExists($dir)) { … … 1451 1451 if ($item != '.' && $item != '..') { 1452 1452 // 文末の/を取り除く 1453 $dir = ereg_replace("/$", '', $dir);1453 $dir = rtrim($dir, '/'); 1454 1454 $path = $dir.'/'.$item; 1455 1455 // ディレクトリのみ取得 … … 1491 1491 while ($file = readdir($handle)) { 1492 1492 // 行末の/を取り除く 1493 $dir = ereg_replace("/$", '', $dir);1493 $dir = rtrim($dir, '/'); 1494 1494 $path = $dir.'/'.$file; 1495 1495 if ($file != '..' && $file != '.' && is_dir($path)) {
Note: See TracChangeset
for help on using the changeset viewer.