mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Fixed a bug -- Nodes of certain types don't actually have ID values and PHP
would segv trying to read one.
This commit is contained in:
parent
3ab8d263b8
commit
8a36e954f0
@ -985,9 +985,16 @@ static void tidy_add_default_properities(PHPTidyObj *obj, tidy_obj_type type TSR
|
||||
ADD_PROPERITY_STRING(obj->std.properties, value, buf.bp);
|
||||
tidyBufFree(&buf);
|
||||
|
||||
fprintf(stderr, "type: %d\n",tidyNodeGetType(obj->node));
|
||||
ADD_PROPERITY_STRING(obj->std.properties, name, tidyNodeGetName(obj->node));
|
||||
ADD_PROPERITY_LONG(obj->std.properties, type, tidyNodeGetType(obj->node));
|
||||
ADD_PROPERITY_LONG(obj->std.properties, id, tidyNodeGetId(obj->node));
|
||||
switch(tidyNodeGetType(obj->node)) {
|
||||
case TidyNode_Text:
|
||||
case TidyNode_Comment:
|
||||
break;
|
||||
default:
|
||||
ADD_PROPERITY_LONG(obj->std.properties, id, tidyNodeGetId(obj->node));
|
||||
}
|
||||
|
||||
break;
|
||||
case is_attr:
|
||||
|
Loading…
Reference in New Issue
Block a user