开发者

HTMLPurifier config file for kohana

开发者 https://www.devze.com 2023-02-13 19:38 出处:网络
Could you please leave some example of config.php file for kohana fr开发者_如何转开发amework?

Could you please leave some example of config.php file for kohana fr开发者_如何转开发amework? I want to allow users to leave comments with tags like img, a, u, strong and embed youtube videos. I've been looking for it but no result. Thanks.


application/config/purifier.php

<?php defined('SYSPATH') or die('No direct script access.');

return array(
    'preload'   => false,
    'settings'  => array
    (
        'Attr'      =>  array
        (
            'AllowedRel'        =>  array('noindex','nofollow'),
            'DefaultImageAlt'   =>  NULL,
        ),
        'Cache'     =>  array
        (
            'SerializerPath'    =>  Kohana::$cache_dir,
        ),
        'Core'      =>  array
        (
            'ColorKeywords'     =>  array
            (
                'maroon'    => '#800000',
                'red'       => '#FF0000',
                'orange'    => '#FFA500',
                'yellow'    => '#FFFF00',
                'olive'     => '#808000',
                'purple'    => '#800080',
                'fuchsia'   => '#FF00FF',
                'white'     => '#FFFFFF',
                'lime'      => '#00FF00',
                'green'     => '#008000',
                'navy'      => '#000080',
                'blue'      => '#0000FF',
                'aqua'      => '#00FFFF',
                'teal'      => '#008080',
                'black'     => '#000000',
                'silver'    => '#C0C0C0',
                'gray'      => '#808080',
            ),
            'Encoding'          =>  Kohana::$charset,
            'EscapeInvalidTags' =>  FALSE,
        ),
        'HTML'      =>  array
        (
            'AllowedElements'   =>  array
            (
                'a',
                'b',
                'em',
                'small',
                'strong',
                'del',
                'q',
            ),
            'AllowedAttributes' =>  array
            (
                'href',
                'rel',
                'target',
            ),
            /**
             * Document doctype
             * Options : 
             * "HTML 4.01 Transitional"
             * "HTML 4.01 Strict"
             * "XHTML 1.0 Transitional"
             * "XHTML 1.0 Strict"
             * "XHTML 1.1"
             */
            'Doctype'           =>  NULL,
        ),
        'URI'       =>  array
        (
            'AllowedSchemes'    =>  array
            (
                'http'      => true,
                'https'     => true,
                'mailto'    => true,
                'ftp'       => true,
                'nntp'      => true,
                'news'      => true,
            ),
            'Base'              =>  NULL,
        ),
    ),
);
0

精彩评论

暂无评论...
验证码 换一张
取 消