mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-09 23:28:42 +00:00
bb08f679f0
- Work around unnecessary DOMElement type-cast in PH5P that caused errors in PHP 5.1 - Work around PHP 4 SimpleTest lack-of-error complaining for one-time-only HTMLDefinition errors, this may indicate problems with error-collecting facilities in PHP 5 - Make ErrorCollectorEMock work in both PHP 4 and PHP 5 . tests/multitest.php allows you to test multiple versions by running tests/index.php through multiple interpreters using `phpv` shell script (you must provide this script!) . Minor cosmetic change to flush-definition-cache.php: trailing newline is outputted . Maintenance script for generating PH5P patch added, original PH5P source file also added under version control . Full unit test runner script title made more descriptive with PHP version git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1440 48356398-32a2-884e-a903-53898d9a118a
56 lines
2.0 KiB
Diff
56 lines
2.0 KiB
Diff
--- C:\Users\Edward\Webs\htmlpurifier\maintenance\PH5P.php 2007-11-04 23:41:49.074543700 -0500
|
|
+++ C:\Users\Edward\Webs\htmlpurifier\maintenance/PH5P.new.php 2007-11-04 23:54:19.206543700 -0500
|
|
@@ -211,7 +211,10 @@
|
|
// If nothing is returned, emit a U+0026 AMPERSAND character token.
|
|
// Otherwise, emit the character token that was returned.
|
|
$char = (!$entity) ? '&' : $entity;
|
|
- $this->emitToken($char);
|
|
+ $this->emitToken(array(
|
|
+ 'type' => self::CHARACTR,
|
|
+ 'data' => $char
|
|
+ ));
|
|
|
|
// Finally, switch to the data state.
|
|
$this->state = 'data';
|
|
@@ -708,7 +711,7 @@
|
|
} elseif($char === '&') {
|
|
/* U+0026 AMPERSAND (&)
|
|
Switch to the entity in attribute value state. */
|
|
- $this->entityInAttributeValueState('non');
|
|
+ $this->entityInAttributeValueState();
|
|
|
|
} elseif($char === '>') {
|
|
/* U+003E GREATER-THAN SIGN (>)
|
|
@@ -738,7 +741,8 @@
|
|
? '&'
|
|
: $entity;
|
|
|
|
- $this->emitToken($char);
|
|
+ $last = count($this->token['attr']) - 1;
|
|
+ $this->token['attr'][$last]['value'] .= $char;
|
|
}
|
|
|
|
private function bogusCommentState() {
|
|
@@ -1066,6 +1070,11 @@
|
|
$this->char++;
|
|
|
|
if(in_array($id, $this->entities)) {
|
|
+ if ($e_name[$c-1] !== ';') {
|
|
+ if ($c < $len && $e_name[$c] == ';') {
|
|
+ $this->char++; // consume extra semicolon
|
|
+ }
|
|
+ }
|
|
$entity = $id;
|
|
break;
|
|
}
|
|
@@ -3673,7 +3682,8 @@
|
|
}
|
|
}
|
|
|
|
- private function getElementCategory($name) {
|
|
+ private function getElementCategory($node) {
|
|
+ $name = $node->tagName;
|
|
if(in_array($name, $this->special))
|
|
return self::SPECIAL;
|
|
|