Make WordPress Core

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's profile 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)

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

Download all attachments as: .zip

Change History (12)

@simonwheatley
17 years ago

Query error suppression option

@simonwheatley
17 years ago

Query notice ignore option

#1 @simonwheatley
17 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
17 years ago

  • Cc simon@… added

#3 @ryan
16 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

#4 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Warnings/Notices
  • Owner anonymous deleted

#5 @Denis-de-Bernardy
15 years ago

  • Keywords 2nd-opinion removed

see also: #9602

#6 @Denis-de-Bernardy
15 years ago

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

why not add isset() statements as needed?

#7 @dd32
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.

#8 @hakre
15 years ago

  • Keywords reporter-feedback added

At least steps to reproduce are needed.

#9 @Denis-de-Bernardy
15 years ago

fixed along with #9602, no?

#10 @azaozz
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Yes, think so.

Note: See TracTickets for help on using tickets.