From b849d7fc80ace05dc6467f64f31d08527da88380 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 13 Jan 2012 09:19:55 +0000 Subject: [PATCH] adapt html purifiers URIScheme cid to new purifiers class requirements; adapt URIScheme data to accept allowed types in whatever (upper/lower/mixed) case --- .../inc/htmlpurifier/library/HTMLPurifier/URIScheme/cid.php | 5 ++++- .../inc/htmlpurifier/library/HTMLPurifier/URIScheme/data.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/cid.php b/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/cid.php index 7b1d0e2410..104368c4ef 100644 --- a/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/cid.php +++ b/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/cid.php @@ -8,8 +8,11 @@ class HTMLPurifier_URIScheme_cid extends HTMLPurifier_URIScheme { public $browsable = true; + // this is actually irrelevant since we only write out the path + // component + public $may_omit_host = true; - public function validate(&$uri, $config, $context) { + public function doValidate(&$uri, $config, $context) { //error_log(__METHOD__." calledi with:".print_r($uri,true)); //parent::validate($uri, $config, $context); $uri->userinfo = null; diff --git a/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/data.php b/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/data.php index a5c43989e5..863b55c876 100644 --- a/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/data.php +++ b/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/URIScheme/data.php @@ -45,7 +45,7 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { } else { $data = $result[0]; } - if ($content_type !== null && empty($this->allowed_types[$content_type])) { + if ($content_type !== null && empty($this->allowed_types[strtolower($content_type)])) { return false; } if ($charset !== null) {