Skip to content

Commit 278578a

Browse files
committed
Add config option name to error message
1 parent f7cac62 commit 278578a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/tidy/tests/007.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ try {
3131
Current Value of 'tidy-mark': bool(false)
3232
Current Value of 'error-file': string(0) ""
3333
Current Value of 'tab-size': int(8)
34-
tidy::getOpt(): Argument #1 ($option) is an invalid configuration option
35-
tidy_getopt(): Argument #2 ($option) is an invalid configuration option
34+
tidy::getOpt(): Argument #1 ($option) is an invalid configuration option, "bogus-opt" given
35+
tidy_getopt(): Argument #2 ($option) is an invalid configuration option, "non-ASCII string ���" given

ext/tidy/tests/021.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $t = new tidy;
1515
var_dump($t->getOptDoc('ncr'));
1616
var_dump(strlen(tidy_get_opt_doc($t, 'wrap')) > 99);
1717
?>
18-
--EXPECTF--
19-
tidy_get_opt_doc(): Argument #2 ($optname) is an invalid configuration option
18+
--EXPECT--
19+
tidy_get_opt_doc(): Argument #2 ($optname) is an invalid configuration option, "some_bogus_cfg" given
2020
string(73) "This option specifies if Tidy should allow numeric character references. "
2121
bool(true)

ext/tidy/tidy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ PHP_FUNCTION(tidy_get_opt_doc)
11551155
opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
11561156

11571157
if (!opt) {
1158-
zend_argument_value_error(getThis() ? 1 : 2, "is an invalid configuration option");
1158+
zend_argument_value_error(getThis() ? 1 : 2, "is an invalid configuration option, \"%s\" given", optname);
11591159
RETURN_THROWS();
11601160
}
11611161

@@ -1299,7 +1299,7 @@ PHP_FUNCTION(tidy_getopt)
12991299
opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
13001300

13011301
if (!opt) {
1302-
zend_argument_value_error(getThis() ? 1 : 2, "is an invalid configuration option");
1302+
zend_argument_value_error(getThis() ? 1 : 2, "is an invalid configuration option, \"%s\" given", optname);
13031303
RETURN_THROWS();
13041304
}
13051305

0 commit comments

Comments
 (0)