From: Antony Dovgal Date: Wed, 30 Aug 2006 22:34:48 +0000 (+0000) Subject: MFH: fix leak, add test X-Git-Tag: php-5.2.0RC3~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=434d5e9be40c8147137070f6d1eeb5a3fee73517;p=php MFH: fix leak, add test --- diff --git a/ext/tidy/tests/019.phpt b/ext/tidy/tests/019.phpt new file mode 100644 index 0000000000..9d2c693cdb --- /dev/null +++ b/ext/tidy/tests/019.phpt @@ -0,0 +1,38 @@ +--TEST-- +tidy_repair_*() and invalid parameters +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d + +Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d + +Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d + +Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d + +Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d + +Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d + +Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d +Done diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 7057a56899..ba357c3c4b 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -89,7 +89,7 @@ if(Z_TYPE_P(_val) == IS_ARRAY) { \ _php_tidy_apply_config_array(_doc, HASH_OF(_val) TSRMLS_CC); \ } else { \ - convert_to_string_ex(&_val); \ + convert_to_string(_val); \ TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(_val)); \ switch (tidyLoadConfig(_doc, Z_STRVAL_P(_val))) { \ case -1: \