From bf7481d8f257ad248ee9ddb49aa5eaa4c5f8d030 Mon Sep 17 00:00:00 2001 From: Sacha Froment Date: Mon, 23 Mar 2015 12:17:07 +0100 Subject: [PATCH] Add %URI.UnescapeCharacters directive Allow to add char that won't be escape by the uri filter --- library/HTMLPurifier/ConfigSchema/schema.ser | Bin 15305 -> 15404 bytes .../schema/URI.UnescapeCharacters.txt | 9 +++++++++ library/HTMLPurifier/URI.php | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 library/HTMLPurifier/ConfigSchema/schema/URI.UnescapeCharacters.txt diff --git a/library/HTMLPurifier/ConfigSchema/schema.ser b/library/HTMLPurifier/ConfigSchema/schema.ser index 1e6ccd22755dfa27722e17f457a00ea42bdc1d6f..e47dab837ae9446acb9cfe3e0e8c672b2b94c960 100644 GIT binary patch delta 137 zcmX?EzNTV=8IzI0=9faLLNdixMn+ajp+TN{p?Rsr$%zH2&KZeCiOD6YMa7e63i%PI g&`Z^V(RlJpA=%9fRMo{)@foUQooS_OXkA+i0L@q~!~g&Q delta 44 tcmZ2eak6}Z8Iz&qW=`Q$p~-uNyx{CURTD;|$(+Knn;)pEi!s&K0su)_4W$48 diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.UnescapeCharacters.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.UnescapeCharacters.txt new file mode 100644 index 00000000..ce5e7e40 --- /dev/null +++ b/library/HTMLPurifier/ConfigSchema/schema/URI.UnescapeCharacters.txt @@ -0,0 +1,9 @@ +URI.UnescapeCharacters +TYPE: string/null +DEFAULT: NULL +--DESCRIPTION-- + +

+ Defines characters that won't be escape by HTMLPurifier_URI. +

+--# vim: et sw=4 sts=4 \ No newline at end of file diff --git a/library/HTMLPurifier/URI.php b/library/HTMLPurifier/URI.php index a5e7ae29..d5fdfb9a 100644 --- a/library/HTMLPurifier/URI.php +++ b/library/HTMLPurifier/URI.php @@ -106,7 +106,7 @@ class HTMLPurifier_URI public function validate($config, $context) { // ABNF definitions from RFC 3986 - $chars_sub_delims = '!$&\'()*+,;='; + $chars_sub_delims = '!$&\'()*+,;='.$config->get('URI.UnescapeCharacters');; $chars_gen_delims = ':/?#[]@'; $chars_pchar = $chars_sub_delims . ':@';