Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 52... Línea 52...
52
    /**
52
    /**
53
     * @type HTMLPurifier_AttrDef_Enum
53
     * @type HTMLPurifier_AttrDef_Enum
54
     */
54
     */
55
    private $_enum_attrdef;
55
    private $_enum_attrdef;
Línea -... Línea 56...
-
 
56
 
-
 
57
    /**
-
 
58
     * @type HTMLPurifier_AttrDef_Enum
-
 
59
     */
-
 
60
    private $_universal_attrdef;
56
 
61
 
57
    public function __construct()
62
    public function __construct()
58
    {
63
    {
59
        $this->_tidy = new csstidy();
64
        $this->_tidy = new csstidy();
60
        $this->_tidy->set_cfg('lowercase_s', false);
65
        $this->_tidy->set_cfg('lowercase_s', false);
Línea 68... Línea 73...
68
                'active',
73
                'active',
69
                'hover',
74
                'hover',
70
                'focus'
75
                'focus'
71
            )
76
            )
72
        );
77
        );
-
 
78
        $this->_universal_attrdef = new HTMLPurifier_AttrDef_Enum(
-
 
79
            array(
-
 
80
                'initial',
-
 
81
                'inherit',
-
 
82
                'unset',
-
 
83
            )
-
 
84
        );
73
    }
85
    }
Línea 74... Línea 86...
74
 
86
 
75
    /**
87
    /**
76
     * Save the contents of CSS blocks to style matches
88
     * Save the contents of CSS blocks to style matches
Línea 305... Línea 317...
305
                    foreach ($style as $name => $value) {
317
                    foreach ($style as $name => $value) {
306
                        if (!isset($css_definition->info[$name])) {
318
                        if (!isset($css_definition->info[$name])) {
307
                            unset($style[$name]);
319
                            unset($style[$name]);
308
                            continue;
320
                            continue;
309
                        }
321
                        }
-
 
322
                        $uni_ret = $this->_universal_attrdef->validate($value, $config, $context);
-
 
323
                        if ($uni_ret !== false) {
-
 
324
                            $style[$name] = $uni_ret;
-
 
325
                            continue;
-
 
326
                        }
310
                        $def = $css_definition->info[$name];
327
                        $def = $css_definition->info[$name];
311
                        $ret = $def->validate($value, $config, $context);
328
                        $ret = $def->validate($value, $config, $context);
312
                        if ($ret === false) {
329
                        if ($ret === false) {
313
                            unset($style[$name]);
330
                            unset($style[$name]);
314
                        } else {
331
                        } else {