From cc05d279ea9c7317f6393b0336df724dbb4a898f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 14 Jul 2009 07:55:30 -0700 Subject: Update HTMLPurifier to version 4.4.0 --- modules/gallery/lib/HTMLPurifier/HTMLPurifier.includes.php | 2 +- modules/gallery/lib/HTMLPurifier/HTMLPurifier.php | 6 +++--- modules/gallery/lib/HTMLPurifier/HTMLPurifier/Config.php | 2 +- modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer.php | 2 +- modules/gallery/lib/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/gallery/lib') diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier.includes.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier.includes.php index 6ea32f72..e57f2ab3 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier.includes.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier.includes.php @@ -7,7 +7,7 @@ * primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS * FILE, changes will be overwritten the next time the script is run. * - * @version 3.3.0 + * @version 4.0.0 * * @warning * You must *not* include any other HTML Purifier files before this file, diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier.php index 0b53d1b4..71e90632 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier.php @@ -19,7 +19,7 @@ */ /* - HTML Purifier 3.3.0 - Standards Compliant HTML Filtering + HTML Purifier 4.0.0 - Standards Compliant HTML Filtering Copyright (C) 2006-2008 Edward Z. Yang This library is free software; you can redistribute it and/or @@ -55,10 +55,10 @@ class HTMLPurifier { /** Version of HTML Purifier */ - public $version = '3.3.0'; + public $version = '4.0.0'; /** Constant with version of HTML Purifier */ - const VERSION = '3.3.0'; + const VERSION = '4.0.0'; /** Global configuration object */ public $config; diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Config.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Config.php index 5b2592b5..28529e7f 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Config.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Config.php @@ -20,7 +20,7 @@ class HTMLPurifier_Config /** * HTML Purifier's version */ - public $version = '3.3.0'; + public $version = '4.0.0'; /** * Bool indicator whether or not to automatically finalize diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer.php index 3d8010f4..9f20a412 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer.php @@ -285,7 +285,7 @@ class HTMLPurifier_Lexer */ public function extractBody($html) { $matches = array(); - $result = preg_match('!]*>(.+?)!is', $html, $matches); + $result = preg_match('!]*>(.*)!is', $html, $matches); if ($result) { return $matches[1]; } else { diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php index 19676e51..16969bed 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php @@ -23,6 +23,10 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter if (is_null($uri->host) || empty($scheme_obj->browsable)) { return true; } + // don't redirect if target host is our host + if ($uri->host === $config->getDefinition('URI')->host) { + return true; + } $this->makeReplace($uri, $config, $context); $this->replace = array_map('rawurlencode', $this->replace); -- cgit v1.2.3 From a333e01bd1c8cb3ad08cd0ad16023e3fcdfc4181 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Jul 2009 10:32:18 -0700 Subject: Remove trailing ?>. --- .../lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php | 50 +++++++++++----------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'modules/gallery/lib') diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php index 731c3171..81305bcf 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php @@ -3,7 +3,7 @@ /** * Experimental HTML5-based parser using Jeroen van der Meer's PH5P library. * Occupies space in the HTML5 pseudo-namespace, which may cause conflicts. - * + * * @note * Recent changes to PHP's DOM extension have resulted in some fatal * error conditions with the original version of PH5P. Pending changes, @@ -11,7 +11,7 @@ */ class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex { - + public function tokenizeHTML($html, $config, $context) { $new_html = $this->normalize($html, $config, $context); $new_html = $this->wrapHTML($new_html, $config, $context); @@ -32,31 +32,31 @@ class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex { , $tokens); return $tokens; } - + } /* -Copyright 2007 Jeroen van der Meer +Copyright 2007 Jeroen van der Meer -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @@ -1075,7 +1075,7 @@ class HTML5 { // used when parsing entities in text and in attributes. // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): + // one immediately after the U+0026 AMPERSAND character): switch($this->character($this->char + 1)) { // U+0023 NUMBER SIGN (#) @@ -2231,7 +2231,7 @@ class HTML5TreeConstructer { if($this->elementInScope($token['name'])) { $this->generateImpliedEndTags(); - } + } if(end($this->stack)->nodeName !== $token['name']) { /* Now, if the current node is not an element with the @@ -2610,7 +2610,7 @@ class HTML5TreeConstructer { for($x = count($this->stack) - $n; $x >= $n; $x--) { array_pop($this->stack); } - + } else { $category = $this->getElementCategory($node); @@ -3546,7 +3546,7 @@ class HTML5TreeConstructer { // In theory, this should ever be needed, but just in case if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice } - + $el = $this->dom->createElement($token['name']); foreach($token['attr'] as $attr) { @@ -3903,4 +3903,4 @@ class HTML5TreeConstructer { return $this->dom; } } -?> + -- cgit v1.2.3 From 2cd0d6389c39badc1c3c7963e03f80097eaac3c2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Jul 2009 10:44:23 -0700 Subject: Revert "Remove trailing ?>." This reverts commit a333e01bd1c8cb3ad08cd0ad16023e3fcdfc4181. --- .../lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php | 50 +++++++++++----------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'modules/gallery/lib') diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php index 81305bcf..731c3171 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php @@ -3,7 +3,7 @@ /** * Experimental HTML5-based parser using Jeroen van der Meer's PH5P library. * Occupies space in the HTML5 pseudo-namespace, which may cause conflicts. - * + * * @note * Recent changes to PHP's DOM extension have resulted in some fatal * error conditions with the original version of PH5P. Pending changes, @@ -11,7 +11,7 @@ */ class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex { - + public function tokenizeHTML($html, $config, $context) { $new_html = $this->normalize($html, $config, $context); $new_html = $this->wrapHTML($new_html, $config, $context); @@ -32,31 +32,31 @@ class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex { , $tokens); return $tokens; } - + } /* -Copyright 2007 Jeroen van der Meer +Copyright 2007 Jeroen van der Meer -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @@ -1075,7 +1075,7 @@ class HTML5 { // used when parsing entities in text and in attributes. // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): + // one immediately after the U+0026 AMPERSAND character): switch($this->character($this->char + 1)) { // U+0023 NUMBER SIGN (#) @@ -2231,7 +2231,7 @@ class HTML5TreeConstructer { if($this->elementInScope($token['name'])) { $this->generateImpliedEndTags(); - } + } if(end($this->stack)->nodeName !== $token['name']) { /* Now, if the current node is not an element with the @@ -2610,7 +2610,7 @@ class HTML5TreeConstructer { for($x = count($this->stack) - $n; $x >= $n; $x--) { array_pop($this->stack); } - + } else { $category = $this->getElementCategory($node); @@ -3546,7 +3546,7 @@ class HTML5TreeConstructer { // In theory, this should ever be needed, but just in case if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice } - + $el = $this->dom->createElement($token['name']); foreach($token['attr'] as $attr) { @@ -3903,4 +3903,4 @@ class HTML5TreeConstructer { return $this->dom; } } - +?> -- cgit v1.2.3 From ec634c91a6824185485f9349cfe15d6e759bb23e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Jul 2009 10:45:06 -0700 Subject: Stripped the trailing ?> without changing whitespace. --- modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/lib') diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php index 731c3171..0d20c0ce 100644 --- a/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php @@ -3903,4 +3903,4 @@ class HTML5TreeConstructer { return $this->dom; } } -?> + -- cgit v1.2.3