# HG changeset patch # User Yoshiki Yazawa # Date 1268584754 -32400 # Node ID b172a0b1ea48aa670e8e45d7b580a2f35c65bfa6 # Parent db185340a981daf137b428dc9d822ec0b9054700 revoke mb_str_replace for now diff -r db185340a981 -r b172a0b1ea48 Reservation.class.php --- a/Reservation.class.php Sun Mar 14 20:16:04 2010 +0900 +++ b/Reservation.class.php Mon Mar 15 01:39:14 2010 +0900 @@ -199,38 +199,38 @@ $day_of_week = array( "日","月","火","水","木","金","土" ); $filename = $settings->filename_format; - // %TITLE% - $filename = mb_str_replace("%TITLE%", $fn_title, $filename); - // %ST% 開始日時 - $filename = mb_str_replace("%ST%",date("YmdHis", $start_time), $filename ); - // %ET% 終了日時 - $filename = mb_str_replace("%ET%",date("YmdHis", $end_time), $filename ); - // %TYPE% GR/BS - $filename = mb_str_replace("%TYPE%",$crec->type, $filename ); - // %CH% チャンネル番号 - $filename = mb_str_replace("%CH%","".$crec->channel, $filename ); - // %DOW% 曜日(Sun-Mon) - $filename = mb_str_replace("%DOW%",date("D", $start_time), $filename ); - // %DOWJ% 曜日(日-土) - $filename = mb_str_replace("%DOWJ%",$day_of_week[(int)date("w", $start_time)], $filename ); - // %YEAR% 開始年 - $filename = mb_str_replace("%YEAR%",date("Y", $start_time), $filename ); - // %MONTH% 開始月 - $filename = mb_str_replace("%MONTH%",date("m", $start_time), $filename ); - // %DAY% 開始日 - $filename = mb_str_replace("%DAY%",date("d", $start_time), $filename ); - // %HOUR% 開始時 - $filename = mb_str_replace("%HOUR%",date("H", $start_time), $filename ); - // %MIN% 開始分 - $filename = mb_str_replace("%MIN%",date("i", $start_time), $filename ); - // %SEC% 開始秒 - $filename = mb_str_replace("%SEC%",date("s", $start_time), $filename ); - // %DURATION% 録画時間(秒) - $filename = mb_str_replace("%DURATION%","".$duration, $filename ); - // あると面倒くさそうな文字を全部_に $fn_title = mb_ereg_replace("[ \./\*:<>\?\\|()\'\"&]","_", trim($title) ); + // %TITLE% + $filename = str_replace("%TITLE%", $fn_title, $filename); + // %ST% 開始日時 + $filename = str_replace("%ST%",date("YmdHis", $start_time), $filename ); + // %ET% 終了日時 + $filename = str_replace("%ET%",date("YmdHis", $end_time), $filename ); + // %TYPE% GR/BS + $filename = str_replace("%TYPE%",$crec->type, $filename ); + // %CH% チャンネル番号 + $filename = str_replace("%CH%","".$crec->channel, $filename ); + // %DOW% 曜日(Sun-Mon) + $filename = str_replace("%DOW%",date("D", $start_time), $filename ); + // %DOWJ% 曜日(日-土) + $filename = str_replace("%DOWJ%",$day_of_week[(int)date("w", $start_time)], $filename ); + // %YEAR% 開始年 + $filename = str_replace("%YEAR%",date("Y", $start_time), $filename ); + // %MONTH% 開始月 + $filename = str_replace("%MONTH%",date("m", $start_time), $filename ); + // %DAY% 開始日 + $filename = str_replace("%DAY%",date("d", $start_time), $filename ); + // %HOUR% 開始時 + $filename = str_replace("%HOUR%",date("H", $start_time), $filename ); + // %MIN% 開始分 + $filename = str_replace("%MIN%",date("i", $start_time), $filename ); + // %SEC% 開始秒 + $filename = str_replace("%SEC%",date("s", $start_time), $filename ); + // %DURATION% 録画時間(秒) + $filename = str_replace("%DURATION%","".$duration, $filename ); + // 文字コード変換 if( defined("FILESYSTEM_ENCODING") ) { // $filename = mb_convert_encoding( $filename, FILESYSTEM_ENCODING, "UTF-8" ); diff -r db185340a981 -r b172a0b1ea48 reclib.php --- a/reclib.php Sun Mar 14 20:16:04 2010 +0900 +++ b/reclib.php Mon Mar 15 01:39:14 2010 +0900 @@ -21,23 +21,4 @@ "// -->\n" ); } -// マルチバイトstr_replace - -function mb_str_replace($search, $replace, $target, $encoding = "UTF-8" ) { - $notArray = !is_array($target) ? TRUE : FALSE; - $target = $notArray ? array($target) : $target; - $search_len = mb_strlen($search, $encoding); - $replace_len = mb_strlen($replace, $encoding); - - foreach ($target as $i => $tar) { - $offset = mb_strpos($tar, $search); - while ($offset !== FALSE){ - $tar = mb_substr($tar, 0, $offset).$replace.mb_substr($tar, $offset + $search_len); - $offset = mb_strpos($tar, $search, $offset + $replace_len); - } - $target[$i] = $tar; - } - return $notArray ? $target[0] : $target; -} - ?> \ No newline at end of file