NobuNobu
nobun****@users*****
2006年 12月 3日 (日) 23:52:20 JST
Index: xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php diff -u xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php:1.1.2.1 xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php:1.1.2.2 --- xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php:1.1.2.1 Sun Dec 3 00:36:01 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php Sun Dec 3 23:52:19 2006 @@ -1,7 +1,7 @@ <?php /** * @package Legacy - * @version $Id: Legacy_TextFilter.class.php,v 1.1.2.1 2006/12/02 15:36:01 nobunobu Exp $ + * @version $Id: Legacy_TextFilter.class.php,v 1.1.2.2 2006/12/03 14:52:19 nobunobu Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -14,8 +14,8 @@ } } - function ToShow($str) { - return preg_replace(array("/&/i", "/ /i"), array('&', '&nbsp;'), htmlspecialchars($str, ENT_QUOTES)); + function ToShow($str) {//ToDo: patern is defined for XOOPS2.0 compatiblity. But what is it? + return preg_replace(array("/&(#[0-9]+|#x[0-9a-f]+|[a-z]+[0-9]*);/i", "/ /i"), array('&\\1;', '&nbsp;'), htmlspecialchars($str, ENT_QUOTES)); } function ToEdit($str) {