Skip to content

Commit

Permalink
Fixed compatibility with "Run Time Cache" patch
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed May 25, 2010
1 parent f7ce695 commit 25893b6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ext/tidy/tidy.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
tidySaveBuffer (obj->ptdoc->doc, &output);

if (output.size) {
if (!obj->std.properties) {
rebuild_object_properties(&obj->std);
}
MAKE_STD_ZVAL(temp);
ZVAL_STRINGL(temp, (char*)output.bp, output.size-1, TRUE);
zend_hash_update(obj->std.properties, "value", sizeof("value"), (void *)&temp, sizeof(zval *), NULL);
Expand All @@ -836,6 +839,9 @@ static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
tidyBufFree(&output);

if (obj->ptdoc->errbuf->size) {
if (!obj->std.properties) {
rebuild_object_properties(&obj->std);
}
MAKE_STD_ZVAL(temp);
ZVAL_STRINGL(temp, (char*)obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, TRUE);
zend_hash_update(obj->std.properties, "errorBuffer", sizeof("errorBuffer"), (void *)&temp, sizeof(zval *), NULL);
Expand All @@ -854,6 +860,9 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
switch(type) {

case is_node:
if (!obj->std.properties) {
rebuild_object_properties(&obj->std);
}
tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
ADD_PROPERTY_STRINGL(obj->std.properties, value, buf.bp, buf.size-1);
Expand Down Expand Up @@ -923,6 +932,9 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
break;

case is_doc:
if (!obj->std.properties) {
rebuild_object_properties(&obj->std);
}
ADD_PROPERTY_NULL(obj->std.properties, errorBuffer);
ADD_PROPERTY_NULL(obj->std.properties, value);
break;
Expand Down

0 comments on commit 25893b6

Please sign in to comment.