HTML_Safe parse error
Brought to you by:
cbruyland
Ok... basically the HTML_Safe parser has an error. If you have a tag (let's say Bold) ... and you open and close it .... then when you re-open it... you can never close it except at a forced close point (end of paragraph.)
here's the patch:
--- HTML_Safe.php.old 2007-01-16 18:54:12.000000000 -0600
+++ HTML_Safe.php 2007-01-16 18:54:33.000000000 -0600
@@ -438,7 +438,7 @@ class HTML_Safe
$this->_writeAttrs($attrs);
$this->_xhtml .= '>';
array_push($this->_stack,$name);
- $this->_counter[$name] = isset($this->_counter[$name]) ? $this->_counter[$name]++ : 1;
+ $this->_counter[$name] = isset($this->_counter[$name]) ? ($this->_counter[$name] + 1) : 1;
return true;
}
Logged In: NO
Instead off $this->_counter[$name]++ you can write: ++$this->_counter[$name]
Logged In: YES
user_id=596175
Originator: YES
You are absolutly correct. However most programmers do not know the difference between pre and post inc so when pre is needed, for clarity I normally do it the long way. :)