eXtplorer-2.0.1-ja.1.patch [ダウンロード]

diff -Nur eXtplorer-2.0.1/admin.extplorer.php eXtplorer-2.0.1-ja.1/admin.extplorer.php
--- eXtplorer-2.0.1/admin.extplorer.php	2009-01-16 06:30:14.000000000 +0900
+++ eXtplorer-2.0.1-ja.1/admin.extplorer.php	2009-07-06 16:42:59.000000000 +0900
@@ -82,7 +82,7 @@
 
 if( $action == 'include_javascript' ) {
   	while (@ob_end_clean());
-  	header("Content-type: application/x-javascript; charset=iso-8859-1");
+  	header("Content-type: application/x-javascript; charset=utf-8");
   	include( _EXT_PATH.'/scripts/'.basename(extGetParam($_REQUEST, 'file' )).'.php');
   	ext_exit();
 }
diff -Nur eXtplorer-2.0.1/include/admin.php eXtplorer-2.0.1-ja.1/include/admin.php
--- eXtplorer-2.0.1/include/admin.php	2008-01-30 08:39:54.000000000 +0900
+++ eXtplorer-2.0.1-ja.1/include/admin.php	2009-07-06 18:21:38.000000000 +0900
@@ -244,7 +244,7 @@
 	}
 	activate_user($data[0],NULL);
 	
-	ext_Result::sendResult('changepwd', false, ext_Lang::msg('change_password_success'));
+	ext_Result::sendResult('changepwd', true, ext_Lang::msg('change_password_success'));
 }
 //------------------------------------------------------------------------------
 function adduser($dir) {			// Add User
diff -Nur eXtplorer-2.0.1/include/bookmarks.php eXtplorer-2.0.1-ja.1/include/bookmarks.php
--- eXtplorer-2.0.1/include/bookmarks.php	2008-02-03 19:16:40.000000000 +0900
+++ eXtplorer-2.0.1-ja.1/include/bookmarks.php	2008-11-27 11:33:04.000000000 +0900
@@ -62,6 +62,11 @@
 		}
 	}
 }
+
+function strip_invalid_key_char($s, $replacement ="") {
+  return preg_replace('/[{}|&~![()"]/u', $replacement, $s);
+}
+
 /**
  * Adds a new bookmark to the bookmark ini file
  *
@@ -91,7 +96,8 @@
 			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 = 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;
@@ -199,4 +205,4 @@
 	return $html;
 }
 
-?>
\ No newline at end of file
+?>
diff -Nur eXtplorer-2.0.1/include/edit.php eXtplorer-2.0.1-ja.1/include/edit.php
--- eXtplorer-2.0.1/include/edit.php	2008-05-31 15:55:46.000000000 +0900
+++ eXtplorer-2.0.1-ja.1/include/edit.php	2008-11-26 14:14:00.000000000 +0900
@@ -38,6 +38,24 @@
  *
  */
 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,6 +90,28 @@
 			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);
@@ -129,6 +169,29 @@
 	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 );
 		
 	?>