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:
John Coggeshall 2003-11-03 16:35:58 +00:00
parent 3ab8d263b8
commit 8a36e954f0

View File

@ -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: