(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--這個修改可能並非適合每一個人