森林之原
五月 23, 2012, 11:50:03 pm *
歡迎光臨, 訪客. 請先 登入註冊一個帳號.

請輸入帳號, 密碼以及預計登入時間
新聞: 官方釋出 SMF 2.0 beta。繁體中文已經完成。請到 SMF 的版面下載測試。如有問題請通知。
 
   首頁   說明 搜尋 日曆 登入 註冊  
頁: [1]   向下
  寄送主題  |  列印  
作者 主題: 內嵌於Mambom後SMF新文章中的code字元異常問題  (閱讀 4152 次)
0 會員 以及 1 訪客 正在閱讀本篇主題.
landry
訪客
« 於: 一月 29, 2005, 10:42:48 am »

(SMF1.0.1_內嵌於Mambo4.5.1a_by_Bridge V2.2)
內嵌於Mambom後,於smf中發表文章時,會出現字元異常的問題,
1.例如"\"變成"\\\\",類似的斜線問題可能與php.ini 中magic_quotes_gpc is off 有關,較好解決。
  可嘗試 magic_quotes_gpc改為on ,或在資料夾中加入 .htaccess 檔,並加入內容
程式碼:
php_flag magic_quotes_gpc on

2.當輸入"aaa<bbb",會變成 "aaa".
   編輯Mambo/includes/mambo.php.
   其中的function mosGetParam().
   
Find this:
程式碼:
function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!($mask&_MOS_ALLOWHTML)) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}
and replace with this:
程式碼:
function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
$return = null;
if (isset( $arr[$name] )) {
if (is_string( $arr[$name] )) {
if (!($mask&_MOS_NOTRIM)) {
$arr[$name] = trim( $arr[$name] );
}
if (!defined("_MOS_ALLOWHTML")) {
$arr[$name] = strip_tags( $arr[$name] );
}
if (!get_magic_quotes_gpc()) {
$arr[$name] = addslashes( $arr[$name] );
}
}
return $arr[$name];
} else {
return $def;
}
}

參考來源http://www.simplemachines.org/community/index.php?topic=26093.0
*PS--這個修改可能並非適合每一個人
向版主檢舉   已記錄
Andrew::
魔,羯
*
離線 離線

文章: 217



個人網站
« 回覆文章 #1 於: 一月 29, 2005, 10:17:42 pm »

多謝分享
向版主檢舉   已記錄

頁: [1]   向上
  寄送主題  |  列印  
 
前往:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Valid XHTML 1.0! Valid CSS!