diff C3 config/jp_conf.php config/jp_conf.php *** config/jp_conf.php Thu Jan 01 09:00:00 1970 --- config/jp_conf.php Mon Jan 26 16:56:06 2009 *************** *** 0 **** --- 1,46 ---- + diff C3 include/admin.php include/admin.php *** include/admin.php Wed Jan 30 08:39:54 2008 --- include/admin.php Mon Jan 26 15:22:58 2009 *************** *** 240,246 **** $data[1]=extEncodePassword(stripslashes($GLOBALS['__POST']["newpwd1"])); if(!update_user($data[0],$data)) { ! ext_Result::sendResult('changepwd', false, $data[0].": ".$GLOBALS["error_msg"]["chpass"]); } activate_user($data[0],NULL); --- 240,246 ---- $data[1]=extEncodePassword(stripslashes($GLOBALS['__POST']["newpwd1"])); if(!update_user($data[0],$data)) { ! ext_Result::sendResult('changepwd', true, $data[0].": ".$GLOBALS["error_msg"]["chpass"]); } activate_user($data[0],NULL); diff C3 include/bookmarks.php include/bookmarks.php *** include/bookmarks.php Sun Feb 03 19:16:40 2008 --- include/bookmarks.php Mon Jan 26 15:26:54 2009 *************** *** 62,67 **** --- 62,72 ---- } } } + + function strip_invalid_key_char($s, $replacement ="") { + return preg_replace('/[{}|&~![()"]/u', $replacement, $s); + } + /** * Adds a new bookmark to the bookmark ini file * *************** *** 91,97 **** if( in_array( $dir, $bookmarks )) { echo ext_alertBox( $GLOBALS['messages']['already_bookmarked'] ); exit; } ! $alias = preg_replace('~[^\w-.\/\\\]~','', $alias ); // Make the alias ini-safe by removing all non-word characters $bookmarks[$alias] = $dir; //we deal with the flippped array here $msg = ext_alertBox( $GLOBALS['messages']['bookmark_was_added'] ); break; --- 96,103 ---- if( in_array( $dir, $bookmarks )) { echo ext_alertBox( $GLOBALS['messages']['already_bookmarked'] ); exit; } ! //$alias = preg_replace('~[^\w-.\/\\\]~','', $alias ); // Make the alias ini-safe by removing all non-word characters ! $alias = strip_invalid_key_char($alias, "_"); $bookmarks[$alias] = $dir; //we deal with the flippped array here $msg = ext_alertBox( $GLOBALS['messages']['bookmark_was_added'] ); break; diff C3 include/download.php include/download.php *** include/download.php Sun Feb 03 19:16:40 2008 --- include/download.php Mon Jan 26 16:51:14 2009 *************** *** 67,79 **** } $browser=id_browser(); header('Content-Type: '.(($browser=='IE' || $browser=='OPERA')? ! 'application/octetstream':'application/octet-stream')); header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize(realpath($abs_item))); //header("Content-Encoding: none"); if($browser=='IE') { ! header('Content-Disposition: attachment; filename="'.$item.'"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { --- 67,79 ---- } $browser=id_browser(); header('Content-Type: '.(($browser=='IE' || $browser=='OPERA')? ! 'application/octetstream':'application/octet-stream').'; Charset=UTF-8'); header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize(realpath($abs_item))); //header("Content-Encoding: none"); if($browser=='IE') { ! header('Content-Disposition: attachment; filename="'.urlencode($item).'"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { *************** *** 82,89 **** header('Pragma: no-cache'); } @set_time_limit( 0 ); ! @readFileChunked(utf8_decode($abs_item)); ! if( $unlink==true ) { unlink( utf8_decode($abs_item) ); } --- 82,97 ---- header('Pragma: no-cache'); } @set_time_limit( 0 ); ! if($GLOBALS['jp_conf']['use_jp']) { ! if (mb_detect_encoding($abs_item) == 'ASCII') { ! @readFileChunked(utf8_decode($abs_item)); ! } else { ! @readFileChunked($abs_item); ! } ! } else { ! @readFileChunked(utf8_decode($abs_item)); ! } ! if( $unlink==true ) { unlink( utf8_decode($abs_item) ); } diff C3 include/edit.php include/edit.php *** include/edit.php Sat May 31 15:55:46 2008 --- include/edit.php Mon Jan 26 15:43:31 2009 *************** *** 38,44 **** * */ class ext_Edit extends ext_Action { ! function execAction($dir, $item) { // edit file global $mainframe, $mosConfig_live_site; --- 38,62 ---- * */ class ext_Edit extends ext_Action { ! var $lang_tbl = Array( ! 'czech' => 'cs', ! 'german' => 'de', ! 'danish' => 'dk', ! 'english' => 'en', ! 'esperanto' => 'eo', ! 'spanish' => 'es', ! 'french' => 'fr', ! 'croatian' => 'hr', ! 'italian' => 'it', ! 'japanese' => 'ja', ! 'macedonian' => 'mk', ! 'dutch' => 'nl', ! 'polish' => 'pl', ! 'portuguese' => 'pt', ! 'russian' => 'ru', ! 'slovenian' => 'sk' ! ); ! function execAction($dir, $item) { // edit file global $mainframe, $mosConfig_live_site; *************** *** 72,78 **** ext_Result::sendResult('edit', true, ext_Lang::msg('savefile').': '.$item ); } ! // header $s_item=get_rel_item($dir,$item); if(strlen($s_item)>50) $s_item="...".substr($s_item,-47); $s_info = pathinfo( $s_item ); --- 90,119 ---- ext_Result::sendResult('edit', true, ext_Lang::msg('savefile').': '.$item ); } ! ! if(isset($GLOBALS['__POST']["doreopen"]) && $GLOBALS['__POST']["doreopen"]=="yes") { ! // File Reopen ! $extra = Array(); ! $content = $GLOBALS['ext_File']->file_get_contents( $fname ); ! if( get_magic_quotes_runtime()) { ! $content = stripslashes( $content ); ! } ! ! $langs = $GLOBALS["language"]; ! if ($langs == "japanese"){ ! $_encoding = $GLOBALS['__POST']["file_encoding"]; ! if ($content){ ! $content = mb_convert_encoding($content, "UTF-8", $_encoding); ! } ! $extra["file_encoding"] = $_encoding; ! } ! ! $extra["content"] = $content; ! ! ext_Result::sendResult('edit', true, ext_Lang::msg('reopenfile').': '.$item, $extra); ! ! } ! // header $s_item=get_rel_item($dir,$item); if(strlen($s_item)>50) $s_item="...".substr($s_item,-47); $s_info = pathinfo( $s_item ); *************** *** 129,134 **** --- 170,198 ---- if( get_magic_quotes_runtime()) { $content = stripslashes( $content ); } + + $cw = 250; + $langs = $GLOBALS["language"]; + if ($langs == "japanese"){ + $cw = 200; + if ($content){ + $_encoding = strtoupper(mb_detect_encoding($content, Array("ASCII", "ISO-2022-JP", "UTF-8", "EUCJP-WIN", "SJIS-WIN"), true)); + $content = mb_convert_encoding($content, "UTF-8", $_encoding); + if ($_encoding == "SJIS-WIN"){ + $_encoding_label = "SJIS"; + } elseif ($_encoding == "EUCJP-WIN"){ + $_encoding_label = "EUC-JP"; + } elseif ($_encoding == "ISO-2022-JP"){ + $_encoding_label = "JIS"; + } elseif ($_encoding == "ASCII"){ + $_encoding_label = "UTF-8"; + } else { + $_encoding_label = $_encoding; + } + } else { + $_encoding_label = "UTF-8"; + } + } //$content = htmlspecialchars( $content ); ?>