mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +02:00
[2.0.1] Revamp error collector scheme: we now have custom mocks and an exchange of responsibilities
- Fix oversight in AutoParagraph dealing with armor. - Order errors with no line number last - Language object now needs $config and $context objects to do parameterized objects - Auto-close notice added - Token constructors accept line numbers git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1245 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -66,7 +66,7 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
|
||||
* @param $name String name.
|
||||
* @param $attr Associative array of attributes.
|
||||
*/
|
||||
function HTMLPurifier_Token_Tag($name, $attr = array()) {
|
||||
function HTMLPurifier_Token_Tag($name, $attr = array(), $line = null) {
|
||||
$this->name = ctype_lower($name) ? $name : strtolower($name);
|
||||
foreach ($attr as $key => $value) {
|
||||
// normalization only necessary when key is not lowercase
|
||||
@@ -81,6 +81,7 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token // abstract
|
||||
}
|
||||
}
|
||||
$this->attr = $attr;
|
||||
$this->line = $line;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,9 +135,10 @@ class HTMLPurifier_Token_Text extends HTMLPurifier_Token
|
||||
*
|
||||
* @param $data String parsed character data.
|
||||
*/
|
||||
function HTMLPurifier_Token_Text($data) {
|
||||
function HTMLPurifier_Token_Text($data, $line = null) {
|
||||
$this->data = $data;
|
||||
$this->is_whitespace = ctype_space($data);
|
||||
$this->line = $line;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -153,8 +155,9 @@ class HTMLPurifier_Token_Comment extends HTMLPurifier_Token
|
||||
*
|
||||
* @param $data String comment data.
|
||||
*/
|
||||
function HTMLPurifier_Token_Comment($data) {
|
||||
function HTMLPurifier_Token_Comment($data, $line = null) {
|
||||
$this->data = $data;
|
||||
$this->line = $line;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user