-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing error check on tidyLoadConfig
Parse errors were not reported for the default config, they were only reported when explicitly another config was loaded. This means that users may not be aware of errors in their configuration and therefore the behaviour of Tidy might not be what they intended. This patch fixes that issue by using a common function. In fact, the check for -1 might be enough for the current implementation of Tidy, but the Tidy docs say that any value other than 0 indicates an error. So future errors might not be caught when just using an error code of -1. Therefore, this also changes the error code checks of == -1 to < 0 and == 1 to > 0. Closes GH-10636 Signed-off-by: George Peter Banyard <girgias@php.net>
- Loading branch information
Showing
5 changed files
with
29 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--TEST-- | ||
GH-10636 (Tidy does not output notice when it encountered parse errors in the default configuration file) | ||
--EXTENSIONS-- | ||
tidy | ||
--INI-- | ||
tidy.default_config={PWD}/gh10636_config | ||
--FILE-- | ||
<?php | ||
$a = new tidy(__DIR__."/007.html"); | ||
?> | ||
--EXPECTF-- | ||
Notice: main(): There were errors while parsing the Tidy configuration file "%sgh10636_config" in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
indent:@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters