執行 Gallery Remote 的除錯版本, 可以發現在傳送字串時, 會把中文轉成 UTF-8, 但是是轉成 〹 之類的碼. 但是 Gallery2 在收到時, 會把 & 再轉成 &, 所以就變成了 〹. 這樣子在網頁上看到的就變成 〹 而不是一個中文字了.
下面這個 patch, 可以修正這個問題:
--- GalleryRemote.inc.orig 2006-03-21 17:27:06.717001028 +0800
+++ GalleryRemote.inc 2006-03-21 18:16:00.940218189 +0800
@@ -73,6 +73,7 @@
function handleRequest($form) {
global $gallery;
+ GalleryUtilities::unsanitizeInputValues($form, false);
$start = array_sum(explode(' ', microtime()));
$status = $error = array();
可以由這兒抓取: http://www.teatime.com.tw/~tommy/mypatch/gallery_remote_and.patch
這個是對 Gallery 2.1RC2a 所做的 patch, 如果你的版本不一樣, 就找看看 module/remote/GalleryRemote.inc 這個檔案的 handleRequest 這個 function. 在裡頭加上 GalleryUtilities::unsanitizeInputValues($form, false); 就可以了.
這個 patch 已經 submit 給 Gallery team: http://sourceforge.net/tracker/index.php?func=detail&aid=1455284&group_id=7130&atid=307130
您好
您上面的連結的 patch 檔案是針對 Gallery 2.1 RC2a
那我目前使用的是 Gallery 2.2 就不適用了是嗎?
那我是否就照您所說在 modulr/remote/GalleryRemote.inc 裡面加上 GalleryUtilities::unsanitizeInputValues($form, false); 就可以了
還要再請問一個可能您會覺得很笨的問題
您提供的 patch 要如何使用?
謝謝!
沒錯, 加上那一行就可以了.
這個修正沒被作者接受... 所以到 2.2 仍可以使用.