Opened 17 years ago
Closed 15 years ago
#6665 closed defect (bug) (fixed)
Evaling the $query in Class WP throws a notice
Reported by: | simonwheatley | Owned by: | |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Warnings/Notices | Keywords: | needs-patch reporter-feedback |
Focuses: | Cc: |
Description
I've just turned on the WP_DEBUG (#5033), for more picky error handling and am making an effort to clean up my WP install to run with no errors of any kind (not even Notices).
The evaling of $query in the Class WP throws a Notice as all indexes in $matches are not always returned by the above preg_match. How about suppressing errors in that eval (see attached patch, query_error_suppress.patch)? If suppressing errors is not preferred, how about lowering the error_handling at that point to ignore Notices (see attached patch, query_notice_ignore.patch)?
I prefer ignoring Notices temporarily, as it allows other errors to be caught and logged.
Attachments (2)
Change History (12)
#1
@
17 years ago
Forgot to add steps to reproduce:
- Define the constant "WP_DEBUG" in your wp_config.php
- Access a page in your Wordpress installation
- (Open the PHP error log if you're not tailing it)
- See the Notice, similar to:
Notice:Undefined offset: 2 in /Users/simon/Projects/WordPress-2.5/site/wp-includes/classes.php(111) : eval()'d code:1
#6
@
15 years ago
- Keywords needs-patch added; has-patch needs-testing removed
why not add isset() statements as needed?
#7
@
15 years ago
- Version set to 2.5
why not add isset() statements as needed?
...I'm not sure that'll work..
What i'm more interested in however, is what rewrite rule is throwing the noticed (If its still even current), In reality, if the rewrite rule is being matched, but not returning anything, then a few more specific rules are probably needed before the main one.. it results in simpler rules as well as not having this problem..
Is this still current? I've never seen any notices of the such under core trunk without any dodgy plugins.
Query error suppression option