Hello, Here is one more patch for tidy. It corrects two issues: * changed $tidy->error_buf to $tidy->errorBuf (to keep consistency) * fixed a bug in tidy_getopt that returned NULL instead of FALSE for false bool values. ( * cleans the #ifs in zend_module_entry - they aren't needed as this is just for PHP 5)
There is one more issue remaining: <?php $html = '<p>test</I>'; $config = array('foo' => 'bar'); $tidy = tidy_parse_string($html, $config); echo tidy_config_count($tidy); //1 ?> The above script (in the manual) should echo 1, but is echoing 0. This is because you return FALSE for unknown options in _php_tidy_set_tidy_opt. You return false also for read-only values and default values of tidyOptGetType. maybe the better option is to create an integer variable that would contain these errors that aren't passed to the tidy lib. In the tidy_config_count, we would return something like: RETURN_LONG(tidyConfigErrorCount(obj->ptdoc->doc) + internal_config_errors); Nuno
Index: tidy.c =================================================================== RCS file: /repository/php-src/ext/tidy/tidy.c,v retrieving revision 1.46 diff -u -r1.46 tidy.c --- tidy.c 16 Apr 2004 21:51:59 -0000 1.46 +++ tidy.c 17 Apr 2004 10:32:41 -0000 @@ -293,9 +293,7 @@ static zend_object_handlers tidy_object_handlers_exception; zend_module_entry tidy_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, -#endif "tidy", tidy_functions, PHP_MINIT(tidy), @@ -303,9 +301,7 @@ PHP_RINIT(tidy), PHP_RSHUTDOWN(tidy), PHP_MINFO(tidy), -#if ZEND_MODULE_API_NO >= 20010901 PHP_TIDY_MODULE_VERSION, -#endif STANDARD_MODULE_PROPERTIES }; @@ -697,7 +693,7 @@ if (obj->ptdoc->errbuf->size) { MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size, TRUE); - zend_hash_update(obj->std.properties, "error_buf", sizeof("error_buf"), (void *)&temp, sizeof(zval *), NULL); + zend_hash_update(obj->std.properties, "errorBuf", sizeof("errorBuf"), (void *)&temp, sizeof(zval *), NULL); } } @@ -781,7 +777,7 @@ break; case is_doc: - ADD_PROPERTY_NULL(obj->std.properties, error_buf); + ADD_PROPERTY_NULL(obj->std.properties, errorBuf); ADD_PROPERTY_NULL(obj->std.properties, value); break; @@ -1330,7 +1326,7 @@ if (optval) { RETURN_TRUE; } else { - RETURN_NULL(); + RETURN_FALSE; } break;
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php