~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef
7
7
{
8
 
    var $def, $element;
9
 
    
 
8
    public $def, $element;
 
9
 
10
10
    /**
11
11
     * @param $def Definition to wrap
12
12
     * @param $element Element to deny
13
13
     */
14
 
    function HTMLPurifier_AttrDef_CSS_DenyElementDecorator(&$def, $element) {
15
 
        $this->def =& $def;
 
14
    public function __construct($def, $element) {
 
15
        $this->def = $def;
16
16
        $this->element = $element;
17
17
    }
18
18
    /**
19
19
     * Checks if CurrentToken is set and equal to $this->element
20
20
     */
21
 
    function validate($string, $config, $context) {
 
21
    public function validate($string, $config, $context) {
22
22
        $token = $context->get('CurrentToken', true);
23
23
        if ($token && $token->name == $this->element) return false;
24
24
        return $this->def->validate($string, $config, $context);
25
25
    }
26
26
}
 
27
 
 
28
// vim: et sw=4 sts=4