⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmlmodulemanager.php

📁 很棒的在线教学系统
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?phprequire_once 'HTMLPurifier/HTMLModule.php';require_once 'HTMLPurifier/ElementDef.php';require_once 'HTMLPurifier/Doctype.php';require_once 'HTMLPurifier/DoctypeRegistry.php';require_once 'HTMLPurifier/ContentSets.php';require_once 'HTMLPurifier/AttrTypes.php';require_once 'HTMLPurifier/AttrCollections.php';require_once 'HTMLPurifier/AttrDef.php';require_once 'HTMLPurifier/AttrDef/Enum.php';// W3C modulesrequire_once 'HTMLPurifier/HTMLModule/CommonAttributes.php';require_once 'HTMLPurifier/HTMLModule/Text.php';require_once 'HTMLPurifier/HTMLModule/Hypertext.php';require_once 'HTMLPurifier/HTMLModule/List.php';require_once 'HTMLPurifier/HTMLModule/Presentation.php';require_once 'HTMLPurifier/HTMLModule/Edit.php';require_once 'HTMLPurifier/HTMLModule/Bdo.php';require_once 'HTMLPurifier/HTMLModule/Tables.php';require_once 'HTMLPurifier/HTMLModule/Image.php';require_once 'HTMLPurifier/HTMLModule/StyleAttribute.php';require_once 'HTMLPurifier/HTMLModule/Legacy.php';require_once 'HTMLPurifier/HTMLModule/Target.php';require_once 'HTMLPurifier/HTMLModule/Scripting.php';require_once 'HTMLPurifier/HTMLModule/XMLCommonAttributes.php';require_once 'HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';require_once 'HTMLPurifier/HTMLModule/Ruby.php';require_once 'HTMLPurifier/HTMLModule/Object.php';// tidy modulesrequire_once 'HTMLPurifier/HTMLModule/Tidy.php';require_once 'HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';require_once 'HTMLPurifier/HTMLModule/Tidy/XHTML.php';require_once 'HTMLPurifier/HTMLModule/Tidy/Proprietary.php';HTMLPurifier_ConfigSchema::define(    'HTML', 'Doctype', '', 'string',    'Doctype to use during filtering. '.    'Technically speaking this is not actually a doctype (as it does '.    'not identify a corresponding DTD), but we are using this name '.    'for sake of simplicity. When non-blank, this will override any older directives '.    'like %HTML.XHTML or %HTML.Strict.');HTMLPurifier_ConfigSchema::defineAllowedValues('HTML', 'Doctype', array(    '', 'HTML 4.01 Transitional', 'HTML 4.01 Strict',    'XHTML 1.0 Transitional', 'XHTML 1.0 Strict',    'XHTML 1.1'));HTMLPurifier_ConfigSchema::define(    'HTML', 'CustomDoctype', null, 'string/null','A custom doctype for power-users who defined there own documenttype. This directive only applies when %HTML.Doctype is blank.This directive has been available since 2.0.1.');HTMLPurifier_ConfigSchema::define(    'HTML', 'Trusted', false, 'bool',    'Indicates whether or not the user input is trusted or not. If the '.    'input is trusted, a more expansive set of allowed tags and attributes '.    'will be used. This directive has been available since 2.0.0.');HTMLPurifier_ConfigSchema::define(    'HTML', 'AllowedModules', null, 'lookup/null', '<p>    A doctype comes with a set of usual modules to use. Without having    to mucking about with the doctypes, you can quickly activate or    disable these modules by specifying which modules you wish to allow    with this directive. This is most useful for unit testing specific    modules, although end users may find it useful for their own ends.</p><p>    If you specify a module that does not exist, the manager will silently    fail to use it, so be careful! User-defined modules are not affected    by this directive. Modules defined in %HTML.CoreModules are not    affected by this directive. This directive has been available since 2.0.0.</p>');HTMLPurifier_ConfigSchema::define(    'HTML', 'CoreModules', array(        'Structure' => true,        'Text' => true,        'Hypertext' => true,        'List' => true,        'NonXMLCommonAttributes' => true,        'XMLCommonAttributes' => true,        'CommonAttributes' => true     ), 'lookup', '<p>    Certain modularized doctypes (XHTML, namely), have certain modules    that must be included for the doctype to be an conforming document    type: put those modules here. By default, XHTML\'s core modules    are used. You can set this to a blank array to disable core module    protection, but this is not recommended. This directive has been    available since 2.0.0.</p>');class HTMLPurifier_HTMLModuleManager{        /**     * Instance of HTMLPurifier_DoctypeRegistry     * @public     */    var $doctypes;        /**     * Instance of current doctype     * @public     */    var $doctype;        /**     * Instance of HTMLPurifier_AttrTypes     * @public     */    var $attrTypes;        /**     * Active instances of modules for the specified doctype are     * indexed, by name, in this array.     */    var $modules = array();        /**     * Array of recognized HTMLPurifier_Module instances, indexed by      * module's class name. This array is usually lazy loaded, but a     * user can overload a module by pre-emptively registering it.     */    var $registeredModules = array();        /**     * List of extra modules that were added by the user using addModule().     * These get unconditionally merged into the current doctype, whatever     * it may be.     */    var $userModules = array();        /**     * Associative array of element name to list of modules that have     * definitions for the element; this array is dynamically filled.     */    var $elementLookup = array();        /** List of prefixes we should use for registering small names */    var $prefixes = array('HTMLPurifier_HTMLModule_');        var $contentSets;     /**< Instance of HTMLPurifier_ContentSets */    var $attrCollections; /**< Instance of HTMLPurifier_AttrCollections */        /** If set to true, unsafe elements and attributes will be allowed */    var $trusted = false;        function HTMLPurifier_HTMLModuleManager() {                // editable internal objects        $this->attrTypes = new HTMLPurifier_AttrTypes();        $this->doctypes  = new HTMLPurifier_DoctypeRegistry();                // setup default HTML doctypes                // module reuse        $common = array(            'CommonAttributes', 'Text', 'Hypertext', 'List',            'Presentation', 'Edit', 'Bdo', 'Tables', 'Image',            'StyleAttribute', 'Scripting', 'Object'        );        $transitional = array('Legacy', 'Target');        $xml = array('XMLCommonAttributes');        $non_xml = array('NonXMLCommonAttributes');                $this->doctypes->register(            'HTML 4.01 Transitional', false,            array_merge($common, $transitional, $non_xml),            array('Tidy_Transitional', 'Tidy_Proprietary'),            array(),            '-//W3C//DTD HTML 4.01 Transitional//EN',            'http://www.w3.org/TR/html4/loose.dtd'        );                $this->doctypes->register(            'HTML 4.01 Strict', false,            array_merge($common, $non_xml),            array('Tidy_Strict', 'Tidy_Proprietary'),            array(),            '-//W3C//DTD HTML 4.01//EN',            'http://www.w3.org/TR/html4/strict.dtd'        );                $this->doctypes->register(            'XHTML 1.0 Transitional', true,            array_merge($common, $transitional, $xml, $non_xml),            array('Tidy_Transitional', 'Tidy_XHTML', 'Tidy_Proprietary'),            array(),            '-//W3C//DTD XHTML 1.0 Transitional//EN',            'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'        );                $this->doctypes->register(            'XHTML 1.0 Strict', true,            array_merge($common, $xml, $non_xml),            array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Strict', 'Tidy_Proprietary'),            array(),            '-//W3C//DTD XHTML 1.0 Strict//EN',            'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'        );                $this->doctypes->register(            'XHTML 1.1', true,            array_merge($common, $xml, array('Ruby')),            array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Strict'), // Tidy_XHTML1_1            array(),            '-//W3C//DTD XHTML 1.1//EN',            'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'        );            }        /**     * Registers a module to the recognized module list, useful for     * overloading pre-existing modules.     * @param $module Mixed: string module name, with or without     *                HTMLPurifier_HTMLModule prefix, or instance of     *                subclass of HTMLPurifier_HTMLModule.     * @note This function will not call autoload, you must instantiate     *       (and thus invoke) autoload outside the method.     * @note If a string is passed as a module name, different variants     *       will be tested in this order:     *          - Check for HTMLPurifier_HTMLModule_$name     *          - Check all prefixes with $name in order they were added     *          - Check for literal object name     *          - Throw fatal error     *       If your object name collides with an internal class, specify     *       your module manually. All modules must have been included     *       externally: registerModule will not perform inclusions for you!     * @warning If your module has the same name as an already loaded     *          module, your module will overload the old one WITHOUT     *          warning.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -