Changeset 21755 for branches/version-2_12-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2012/04/17 15:53:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.
