Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#6665 closed defect (bug) (fixed)

Evaling the $query in Class WP throws a notice

Reported by: simonwheatley Owned by:
Priority: normal Milestone: 2.9
Component: Warnings/Notices Version: 2.5
Severity: normal Keywords: needs-patch reporter-feedback
Cc: Focuses:

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)

query_error_suppress.patch (416 bytes ) - added by simonwheatley 18 years ago.
Query error suppression option
query_notice_ignore.patch (766 bytes ) - added by simonwheatley 18 years ago.
Query notice ignore option

Download all attachments as: .zip

Change History (12)

@simonwheatley
18 years ago

Query error suppression option

@simonwheatley
18 years ago

Query notice ignore option

#1 @simonwheatley
18 years ago

Forgot to add steps to reproduce:

  1. Define the constant "WP_DEBUG" in your wp_config.php
  1. Access a page in your Wordpress installation
  1. (Open the PHP error log if you're not tailing it)
  1. 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

#2 @simonwheatley
18 years ago

  • Cc simon@… added

#3 @ryan
18 years ago

  • Milestone 2.5.22.9

Milestone 2.5.2 deleted

#4 @Denis-de-Bernardy
17 years ago

  • Component GeneralWarnings/Notices
  • Owner anonymous removed

#5 @Denis-de-Bernardy
17 years ago

  • Keywords 2nd-opinion removed

see also: #9602

#6 @Denis-de-Bernardy
17 years ago

  • Keywords needs-patch added; has-patch needs-testing removed

why not add isset() statements as needed?

#7 @dd32
17 years ago

  • Version2.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.

#8 @hakre
17 years ago

  • Keywords reporter-feedback added

At least steps to reproduce are needed.

#9 @Denis-de-Bernardy
17 years ago

fixed along with #9602, no?

#10 @azaozz
17 years ago

  • Resolutionfixed
  • Status newclosed

Yes, think so.

Note: See TracTickets for help on using tickets.