~ubuntu-branches/ubuntu/maverick/mahara/maverick-updates

« back to all changes in this revision

Viewing changes to htdocs/lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/URI.php

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-07-06 17:35:06 UTC
  • mfrom: (6.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100706173506-gxhn0lwqm0v2ikoo
Tags: 1.2.5-2
* Remove postgresql8.3 from recommends, add postgresql8.4
* Add mysql-server-5.1 to recommends

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
            $uri = substr($uri, 1, $new_length - 1);
35
35
        }
36
36
 
37
 
        $keys   = array(  '(',   ')',   ',',   ' ',   '"',   "'");
38
 
        $values = array('\\(', '\\)', '\\,', '\\ ', '\\"', "\\'");
39
 
        $uri = str_replace($values, $keys, $uri);
 
37
        $uri = $this->expandCSSEscape($uri);
40
38
 
41
39
        $result = parent::validate($uri, $config, $context);
42
40
 
43
41
        if ($result === false) return false;
44
42
 
45
 
        // escape necessary characters according to CSS spec
46
 
        // except for the comma, none of these should appear in the
47
 
        // URI at all
48
 
        $result = str_replace($keys, $values, $result);
 
43
        // extra sanity check; should have been done by URI
 
44
        $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result);
49
45
 
50
 
        return "url($result)";
 
46
        return "url(\"$result\")";
51
47
 
52
48
    }
53
49