NobuNobu
nobun****@users*****
2006年 12月 3日 (日) 00:36:01 JST
Index: xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php diff -u xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.26 xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.27 --- xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.26 Mon Nov 27 15:54:52 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php Sun Dec 3 00:36:01 2006 @@ -18,6 +18,7 @@ require_once XOOPS_ROOT_PATH . "/modules/legacy/kernel/Legacy_CacheInformation.class.php"; require_once XOOPS_ROOT_PATH . "/modules/legacy/kernel/Legacy_PublicControllerStrategy.class.php"; +require_once XOOPS_ROOT_PATH . "/modules/legacy/kernel/Legacy_TextFilter.class.php"; require_once XOOPS_ROOT_PATH . "/modules/legacy/class/Legacy_Debugger.class.php"; /** @@ -105,7 +106,9 @@ $this->mSetupDebugger =& new XCube_Delegate(); $this->mSetupDebugger->add('Legacy_DebuggerManager::createInstance'); - + + $this->mSetupTextFilter->add('Legacy_TextFilter::getInstance',XCUBE_DELEGATE_PRIORITY_FINAL-1); + set_magic_quotes_runtime(0); // ^^; } @@ -167,14 +170,14 @@ $this->_setupLanguage(); + $this->_setupTextFilter(); + $this->_setupConfig(); $this->_setupDebugger(); $this->_processPreBlockFilter(); // What's !? -// $this->_processHostAbstractLayer(); // Move it into prepare() - $this->_setupSession(); $this->_setupUser(); @@ -223,9 +226,9 @@ function _setupEnvironment() { parent::_setupEnvironment(); - require_once XOOPS_ROOT_PATH."/include/version.php"; + require_once XOOPS_ROOT_PATH.'/include/version.php'; - require_once XOOPS_ROOT_PATH."/settings/definition.inc.php"; + require_once XOOPS_ROOT_PATH.'/settings/definition.inc.php'; define("XOOPS_LEGACY_PATH",XOOPS_MODULE_PATH."/".XOOPS_LEGACY_PROC_NAME); require_once XOOPS_ROOT_PATH.'/include/functions.php'; @@ -233,11 +236,11 @@ require_once XOOPS_ROOT_PATH.'/kernel/object.php'; require_once XOOPS_ROOT_PATH.'/class/criteria.php'; require_once XOOPS_ROOT_PATH.'/class/token.php'; - require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; + require_once XOOPS_ROOT_PATH.'/class/module.textsanitizer.php'; - require_once XOOPS_LEGACY_PATH."/kernel/object.php"; // ToDo (here?) - require_once XOOPS_LEGACY_PATH."/kernel/handler.php"; // ToDo - require_once XOOPS_ROOT_PATH."/core/XCube_Utils.class.php"; // ToDo + require_once XOOPS_LEGACY_PATH.'/kernel/object.php'; // ToDo (here?) + require_once XOOPS_LEGACY_PATH.'/kernel/handler.php'; // ToDo + require_once XOOPS_ROOT_PATH.'/core/XCube_Utils.class.php'; // ToDo require_once XOOPS_ROOT_PATH.'/class/xoopssecurity.php'; $GLOBALS['xoopsSecurity'] =& new XoopsSecurity(); Index: xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php diff -u /dev/null xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php:1.1.2.1 --- /dev/null Sun Dec 3 00:36:01 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_TextFilter.class.php Sun Dec 3 00:36:01 2006 @@ -0,0 +1,25 @@ +<?php +/** + * @package Legacy + * @version $Id: Legacy_TextFilter.class.php,v 1.1.2.1 2006/12/02 15:36:01 nobunobu Exp $ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +class Legacy_TextFilter extends XCube_TextFilter +{ + function getInstance(&$instance) { + if (empty($instance)) { + $instance = new Legacy_TextFilter(); + } + } + + function ToShow($str) { + return preg_replace(array("/&/i", "/ /i"), array('&', '&nbsp;'), htmlspecialchars($str, ENT_QUOTES)); + } + + function ToEdit($str) { + return preg_replace("/&(#0?[0-9]{4,6};)/i", '&$1', htmlspecialchars($str, ENT_QUOTES)); + } +} +?>