From: sparky4 Date: Sat, 5 Mar 2011 14:43:29 +0000 (-0600) Subject: modified: lib/lib_common.php X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=01b3b673956ab4d5e52beec7674f5f5b30917219;p=test.git modified: lib/lib_common.php --- diff --git a/lib/lib_common.php b/lib/lib_common.php index 9bacbc9..b89e428 100755 --- a/lib/lib_common.php +++ b/lib/lib_common.php @@ -186,12 +186,13 @@ function error($mes, $dest=''){ /* 文字修整 */ /* テキスト整形 */ function CleanStr($str, $IsAdmin=false){ + global $config; $str = trim($str); // 去除前後多餘空白 if(get_magic_quotes_gpc()) $str = stripslashes($str); // "\"斜線符號去除 // XML 1.1 Second Edition: 部分避免用字 (http://www.w3.org/TR/2006/REC-xml11-20060816/#charsets) $str = preg_replace('/([\x1-\x8\xB-\xC\xE-\x1F\x7F-\x84\x86-\x9F\x{FDD0}-\x{FDDF}])/u', '', htmlspecialchars($str)); - if($IsAdmin && CAP_ISHTML){ // 管理員開啟HTML + if($IsAdmin && $config['CAP.ISHTML']){ // 管理員開啟HTML $str = preg_replace('/<(.*?)>/', '<$1>', $str); // 如果有<...>則轉回<...>成為正常標籤 } return $str;