Index: /branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php
===================================================================
--- /branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php	(revision 21743)
+++ /branches/version-2_12-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php	(revision 21755)
@@ -109,5 +109,6 @@
                 if (SC_Utils_Ex::isBlank($this->arrErr)) {
                     if ($this->tryView($objFormParam)) {
-                        $file_url = htmlspecialchars(ereg_replace($objFormParam->getValue('top_dir'), '', $objFormParam->getValue('select_file')));
+                        $pattern = '/' . preg_quote($objFormParam->getValue('top_dir'), '/') . '/';
+                        $file_url = htmlspecialchars(preg_replace($pattern, '', $objFormParam->getValue('select_file')));
                         $tpl_onload = "win02('./file_view.php?file=". $file_url ."', 'user_data', '600', '400');";
                         $this->setTplOnLoad($tpl_onload);
@@ -317,5 +318,5 @@
     function tryCreateDir($objFileManager, $objFormParam) {
         $create_dir_flg = false;
-        $create_dir = ereg_replace("/$", '', $objFormParam->getValue('now_dir'));
+        $create_dir = rtrim($objFormParam->getValue('now_dir'), '/');
         // ファイル作成
         if ($objFileManager->sfCreateFile($create_dir.'/'.$objFormParam->getValue('create_file'), 0755)) {
@@ -425,5 +426,5 @@
     function lfGetParentDir($dir) {
         $parent_dir = '';
-        $dir = ereg_replace("/$", '', $dir);
+        $dir = rtrim($dir, '/');
         $arrDir = explode('/', $dir);
         array_pop($arrDir);
@@ -431,5 +432,5 @@
             $parent_dir .= "$val/";
         }
-        $parent_dir = ereg_replace("/$", '', $parent_dir);
+        $parent_dir = rtrim($parent_dir, '/');
         return $parent_dir;
     }
@@ -478,6 +479,6 @@
         $is_top_dir = false;
         // 末尾の/をとる
-        $top_dir_check = ereg_replace("/$", '', $objFormParam->getValue('top_dir'));
-        $now_dir_check = ereg_replace("/$", '', $objFormParam->getValue('now_dir'));
+        $top_dir_check = rtrim($objFormParam->getValue('top_dir'), '/');
+        $now_dir_check = rtrim($objFormParam->getValue('now_dir'), '/');
         if ($top_dir_check == $now_dir_check) {
             $is_top_dir = true;
Index: /branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php
===================================================================
--- /branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php	(revision 21743)
+++ /branches/version-2_12-dev/data/class/pages/admin/total/LC_Page_Admin_Total.php	(revision 21755)
@@ -417,5 +417,5 @@
 
             foreach (array_keys($arrList) as $val) {
-                $arrKey[] = ereg_replace('～', '-', $val);
+                $arrKey[] = mb_ereg_replace('～', '-', $val);
             }
 
Index: /branches/version-2_12-dev/data/class/SC_CustomerList.php
===================================================================
--- /branches/version-2_12-dev/data/class/SC_CustomerList.php	(revision 21608)
+++ /branches/version-2_12-dev/data/class/SC_CustomerList.php	(revision 21755)
@@ -85,5 +85,5 @@
             $this->setWhere('(' . $dbFactory->concatColumn(array('tel01', 'tel02', 'tel03')) . ' LIKE ?)');
             $searchTel = $this->addSearchStr($this->arrSql['search_tel']);
-            $this->arrVal[] = ereg_replace('-', '', $searchTel);
+            $this->arrVal[] = str_replace('-', '', $searchTel);
         }
 
Index: /branches/version-2_12-dev/data/class/util/SC_Utils.php
===================================================================
--- /branches/version-2_12-dev/data/class/util/SC_Utils.php	(revision 21750)
+++ /branches/version-2_12-dev/data/class/util/SC_Utils.php	(revision 21755)
@@ -503,7 +503,7 @@
             }
             if ($space) {
-                $line = ereg_replace(", $", '', $line);
+                $line = preg_replace("/, $/", '', $line);
             } else {
-                $line = ereg_replace(",$", '', $line);
+                $line = preg_replace("/,$/", '', $line);
             }
             return $line;
@@ -522,5 +522,5 @@
                 $line .= '"' .$val. '",';
             }
-            $line = ereg_replace(",$", "\r\n", $line);
+            $line = preg_replace("/,$/", "\r\n", $line);
         } else {
             return false;
@@ -714,5 +714,5 @@
     /* 文末の「/」をなくす */
     function sfTrimURL($url) {
-        $ret = ereg_replace("[/]+$", '', $url);
+        $ret = rtrim($url, '/');
         return $ret;
     }
@@ -813,8 +813,8 @@
     // 二回以上繰り返されているスラッシュ[/]を一つに変換する。
     function sfRmDupSlash($istr) {
-        if (ereg('^http://', $istr)) {
+        if (preg_match('|^http://|', $istr)) {
             $str = substr($istr, 7);
             $head = 'http://';
-        } else if (ereg('^https://', $istr)) {
+        } else if (preg_match('|^https://|', $istr)) {
             $str = substr($istr, 8);
             $head = 'https://';
@@ -822,5 +822,5 @@
             $str = $istr;
         }
-        $str = ereg_replace('[/]+', '/', $str);
+        $str = preg_replace('|[/]+|', '/', $str);
         $ret = $head . $str;
         return $ret;
@@ -985,5 +985,5 @@
     // DB取得日時をタイムに変換
     function sfDBDatetoTime($db_date) {
-        $date = ereg_replace("\..*$",'',$db_date);
+        $date = preg_replace("|\..*$|",'',$db_date);
         $time = strtotime($date);
         return $time;
@@ -1076,5 +1076,5 @@
         $count++;  // 無限ループ回避
         $dir = dirname($path);
-        if (ereg("^[/]$", $dir) || ereg("^[A-Z]:[\\]$", $dir) || $count > 256) {
+        if (preg_match("|^[/]$|", $dir) || preg_match("|^[A-Z]:[\\]$|", $dir) || $count > 256) {
             // ルートディレクトリで終了
             return;
@@ -1118,11 +1118,11 @@
             foreach ($fileArray as $key => $data_) {
                 // CVS管理ファイルはコピーしない
-                if (ereg('/CVS/Entries', $data_)) {
+                if (strpos($data_, '/CVS/Entries') !== false) {
                     break;
                 }
-                if (ereg('/CVS/Repository', $data_)) {
+                if (strpos($data_, '/CVS/Repository') !== false) {
                     break;
                 }
-                if (ereg('/CVS/Root', $data_)) {
+                if (strpos($data_, '/CVS/Root') !== false) {
                     break;
                 }
@@ -1242,5 +1242,5 @@
                 while (!feof($src_fp)) {
                     $line = fgets($src_fp);
-                    if (ereg('@version', $line)) {
+                    if (strpos($line, '@version') !== false) {
                         $arrLine = explode(' ', $line);
                         $version = $arrLine[5];
@@ -1325,5 +1325,5 @@
                 // 行末の/を取り除く
                 while (($file = readdir($dh)) !== false) $arrDir[] = $file;
-                $dir = ereg_replace("/$", '', $dir);
+                $dir = rtrim($dir, '/');
                 // アルファベットと数字でソート
                 natcasesort($arrDir);
@@ -1375,5 +1375,5 @@
                 while ($file = readdir($handle)) {
                     // 行末の/を取り除く
-                    $dir = ereg_replace("/$", '', $dir);
+                    $dir = rtrim($dir, '/');
                     $path = $dir.'/'.$file;
                     if ($file != '..' && $file != '.' && !is_dir($path)) {
@@ -1410,5 +1410,5 @@
 
         // 文末の/を取り除く
-        $dir = ereg_replace("/$", '', $dir);
+        $dir = rtrim($dir, '/');
         // 最上位層を格納(user_data/)
         if (sfDirChildExists($dir)) {
@@ -1451,5 +1451,5 @@
                     if ($item != '.' && $item != '..') {
                         // 文末の/を取り除く
-                        $dir = ereg_replace("/$", '', $dir);
+                        $dir = rtrim($dir, '/');
                         $path = $dir.'/'.$item;
                         // ディレクトリのみ取得
@@ -1491,5 +1491,5 @@
                 while ($file = readdir($handle)) {
                     // 行末の/を取り除く
-                    $dir = ereg_replace("/$", '', $dir);
+                    $dir = rtrim($dir, '/');
                     $path = $dir.'/'.$file;
                     if ($file != '..' && $file != '.' && is_dir($path)) {
Index: /branches/version-2_12-dev/data/class/SC_Image.php
===================================================================
--- /branches/version-2_12-dev/data/class/SC_Image.php	(revision 21526)
+++ /branches/version-2_12-dev/data/class/SC_Image.php	(revision 21755)
@@ -29,9 +29,5 @@
     function SC_Image($tmp_dir) {
         // ヘッダファイル読込
-        if (!ereg("/$", $tmp_dir)) {
-            $this->tmp_dir = $tmp_dir . '/';
-        } else {
-            $this->tmp_dir = $tmp_dir;
-        }
+        $this->tmp_dir = rtrim($tmp_dir, '/') . '/';
     }
 
@@ -41,5 +37,5 @@
         $mainname = uniqid('').'.';
         // 拡張子以外を置き換える。
-        $newFileName = ereg_replace("^.*\.",$mainname, $_FILES[$keyname]['name']);
+        $newFileName = preg_replace("/^.*\./", $mainname, $_FILES[$keyname]['name']);
         $result  = $this->MakeThumb($_FILES[$keyname]['tmp_name'], $this->tmp_dir , $max_width, $max_height, $newFileName);
         GC_Utils_Ex::gfDebugLog($result);
Index: /branches/version-2_12-dev/data/class/SC_UploadFile.php
===================================================================
--- /branches/version-2_12-dev/data/class/SC_UploadFile.php	(revision 21684)
+++ /branches/version-2_12-dev/data/class/SC_UploadFile.php	(revision 21755)
@@ -59,6 +59,6 @@
     // ファイル管理クラス
     function SC_UploadFile($temp_dir, $save_dir) {
-        $this->temp_dir = (preg_match("|/$|", $temp_dir) == 0) ? $temp_dir. '/' : $temp_dir;
-        $this->save_dir = (preg_match("|/$|", $save_dir) == 0) ? $save_dir. '/' : $save_dir;
+        $this->temp_dir = rtrim($temp_dir, '/') . '/';
+        $this->save_dir = rtrim($save_dir, '/') . '/';
         $this->file_max = 0;
     }
@@ -117,5 +117,5 @@
                             if ($rename) {
                                 $uniqname = date('mdHi') . '_' . uniqid('').'.';
-                                $this->temp_file[$cnt] = ereg_replace("^.*\.",$uniqname, $_FILES[$keyname]['name']);
+                                $this->temp_file[$cnt] = preg_replace("/^.*\./", $uniqname, $_FILES[$keyname]['name']);
                             } else {
                                 $this->temp_file[$cnt] = $_FILES[$keyname]['name'];
@@ -155,5 +155,5 @@
                         // 一意なファイル名を作成する。
                         $uniqname = date('mdHi') . '_' . uniqid('').'.';
-                        $this->temp_file[$cnt] = ereg_replace("^.*\.",$uniqname, $_FILES[$keyname]['name']);
+                        $this->temp_file[$cnt] = preg_replace("/^.*\./", $uniqname, $_FILES[$keyname]['name']);
                         set_time_limit(0);
                         $result  = copy($_FILES[$keyname]['tmp_name'], $this->temp_dir . $this->temp_file[$cnt]);
@@ -229,5 +229,5 @@
                 if (isset($this->save_file[$cnt])
                     && $this->save_file[$cnt] != ''
-                    && !ereg('^sub/', $this->save_file[$cnt])
+                    && !preg_match('|^sub/|', $this->save_file[$cnt])
                 ) {
 
@@ -249,5 +249,5 @@
                 if (isset($this->save_file[$cnt])
                     && $this->save_file[$cnt] != ''
-                    && !ereg('^sub/', $this->save_file[$cnt])
+                    && !preg_match('|^sub/|', $this->save_file[$cnt])
                 ) {
                     $objImage->deleteImage($this->save_file[$cnt], $this->save_dir);
@@ -311,18 +311,12 @@
         foreach ($this->keyname as $val) {
             if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') {
-                // ファイルパスチェック(パスのスラッシュ/が連続しないようにする。)
-                if (ereg("/$", $temp_url)) {
-                    $arrRet[$val]['filepath'] = $temp_url . $this->temp_file[$cnt];
-                } else {
-                    $arrRet[$val]['filepath'] = $temp_url . '/' . $this->temp_file[$cnt];
-                }
+                // パスのスラッシュ/が連続しないようにする。
+                $arrRet[$val]['filepath'] = rtrim($temp_url, '/') . '/' . $this->temp_file[$cnt];
+
                 $arrRet[$val]['real_filepath'] = $this->temp_dir . $this->temp_file[$cnt];
             } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') {
-                // ファイルパスチェック(パスのスラッシュ/が連続しないようにする。)
-                if (ereg("/$", $save_url)) {
-                    $arrRet[$val]['filepath'] = $save_url . $this->save_file[$cnt];
-                } else {
-                    $arrRet[$val]['filepath'] = $save_url . '/' . $this->save_file[$cnt];
-                }
+                // パスのスラッシュ/が連続しないようにする。
+                $arrRet[$val]['filepath'] = rtrim($save_url, '/') . '/' . $this->save_file[$cnt];
+
                 $arrRet[$val]['real_filepath'] = $this->save_dir . $this->save_file[$cnt];
             }
@@ -438,5 +432,5 @@
         foreach ($this->keyname as $val) {
             if ($arrVal[$val] != '') {
-                if ($this->save_file[$cnt] == '' && !ereg('^sub/', $arrVal[$val])) {
+                if ($this->save_file[$cnt] == '' && !preg_match('|^sub/|', $arrVal[$val])) {
                     $objImage->deleteImage($arrVal[$val], $this->save_dir);
                 }
@@ -451,5 +445,5 @@
         $cnt = 0;
         if ($arrVal['down_realfilename'] != '') {
-            if ($this->save_file[$cnt] == '' && !ereg('^sub/', $arrVal['down_realfilename'])) {
+            if ($this->save_file[$cnt] == '' && !preg_match('|^sub/|', $arrVal['down_realfilename'])) {
                 $objImage->deleteImage($arrVal['down_realfilename'], $this->save_dir);
             }
Index: /branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php
===================================================================
--- /branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php	(revision 21684)
+++ /branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php	(revision 21755)
@@ -46,5 +46,5 @@
                 // 行末の/を取り除く
                 while (($file = readdir($dh)) !== false) $arrDir[] = $file;
-                $dir = ereg_replace("/$", '', $dir);
+                $dir = rtrim($dir, '/');
                 // アルファベットと数字でソート
                 natcasesort($arrDir);
@@ -98,5 +98,5 @@
                 while ($file = readdir($handle)) {
                     // 行末の/を取り除く
-                    $dir = ereg_replace("/$", '', $dir);
+                    $dir = rtrim($dir, '/');
                     $path = $dir.'/'.$file;
                     if ($file != '..' && $file != '.' && !is_dir($path)) {
@@ -173,5 +173,5 @@
 
         // 文末の/を取り除く
-        $dir = ereg_replace("/$", '', $dir);
+        $dir = rtrim($dir, '/');
         // 最上位層を格納(user_data/)
         if ($this->sfDirChildExists($dir)) {
@@ -217,5 +217,5 @@
                     if ($item != '.' && $item != '..') {
                         // 文末の/を取り除く
-                        $dir = ereg_replace("/$", '', $dir);
+                        $dir = rtrim($dir, '/');
                         $path = $dir.'/'.$item;
                         // ディレクトリのみ取得
@@ -258,5 +258,5 @@
                 while ($file = readdir($handle)) {
                     // 行末の/を取り除く
-                    $dir = ereg_replace("/$", '', $dir);
+                    $dir = rtrim($dir, '/');
                     $path = $dir.'/'.$file;
                     if ($file != '..' && $file != '.' && is_dir($path)) {
