Release 2.1.3, merged in 1404 to HEAD.
[htmlpurifier/bfroehle.git] / maintenance / PH5P.patch
blob9365cffe9e1e61da426465dfa2114c812528981d
1 --- C:\Users\Edward\Webs\htmlpurifier\maintenance\PH5P.php 2007-11-04 23:41:49.074543700 -0500
2 +++ C:\Users\Edward\Webs\htmlpurifier\maintenance/PH5P.new.php 2007-11-05 00:23:52.839543700 -0500
3 @@ -211,7 +211,10 @@
4 // If nothing is returned, emit a U+0026 AMPERSAND character token.
5 // Otherwise, emit the character token that was returned.
6 $char = (!$entity) ? '&' : $entity;
7 - $this->emitToken($char);
8 + $this->emitToken(array(
9 + 'type' => self::CHARACTR,
10 + 'data' => $char
11 + ));
13 // Finally, switch to the data state.
14 $this->state = 'data';
15 @@ -708,7 +711,7 @@
16 } elseif($char === '&') {
17 /* U+0026 AMPERSAND (&)
18 Switch to the entity in attribute value state. */
19 - $this->entityInAttributeValueState('non');
20 + $this->entityInAttributeValueState();
22 } elseif($char === '>') {
23 /* U+003E GREATER-THAN SIGN (>)
24 @@ -738,7 +741,8 @@
25 ? '&'
26 : $entity;
28 - $this->emitToken($char);
29 + $last = count($this->token['attr']) - 1;
30 + $this->token['attr'][$last]['value'] .= $char;
33 private function bogusCommentState() {
34 @@ -1066,6 +1070,11 @@
35 $this->char++;
37 if(in_array($id, $this->entities)) {
38 + if ($e_name[$c-1] !== ';') {
39 + if ($c < $len && $e_name[$c] == ';') {
40 + $this->char++; // consume extra semicolon
41 + }
42 + }
43 $entity = $id;
44 break;
46 @@ -3659,7 +3668,7 @@
50 - private function generateImpliedEndTags(array $exclude = array()) {
51 + private function generateImpliedEndTags($exclude = array()) {
52 /* When the steps below require the UA to generate implied end tags,
53 then, if the current node is a dd element, a dt element, an li element,
54 a p element, a td element, a th element, or a tr element, the UA must
55 @@ -3673,7 +3682,8 @@
59 - private function getElementCategory($name) {
60 + private function getElementCategory($node) {
61 + $name = $node->tagName;
62 if(in_array($name, $this->special))
63 return self::SPECIAL;