WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#6667 closed defect (bug) (duplicate)

redirect_canonical throws Notices when WP_DEBUG is set

Reported by: simonwheatley Owned by: westi
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch needs-testing
Focuses: Cc:

Description

Steps to reproduce:

  1. Define the constant WP_DEBUG in wp_config.php
  1. Browse to the blog homepage of a fairly vanilla WP2.5 install
  1. Check the PHP error log, and you should see (or similar):

Notice:Undefined index: path in /Users/simon/Projects/WordPress-2.5/site/wp-includes/canonical.php:174

and

Notice:Undefined index: port in /Users/simon/Projects/WordPress-2.5/site/wp-includes/canonical.php:181

The attached patch, canonical_test_for_vars.patch, amends the two IF statements so that they test the relevant vars with isset before testing if they are true.

Attachments (1)

canonical_test_for_vars.patch (1.2 KB) - added by simonwheatley 7 years ago.
Patch for canonical.php to test for certain vars with isset before other tests are run

Download all attachments as: .zip

Change History (6)

@simonwheatley7 years ago

Patch for canonical.php to test for certain vars with isset before other tests are run

comment:1 @simonwheatley7 years ago

  • Cc simon@… added

comment:2 @westi7 years ago

  • Milestone changed from 2.5.1 to 2.6
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

2.6 is a more appropriate target for these fixes.

comment:3 follow-up: @simonwheatley7 years ago

Hi Westi, in that case, do you want one monster patch file with all the fixes in? I'm working on an implementation project at the moment, so can turn the debugging up to 11 and fix Notices, etc, as I come across them and submit again in about a week or so.

comment:4 in reply to: ↑ 3 @westi7 years ago

Replying to simonwheatley:

Hi Westi, in that case, do you want one monster patch file with all the fixes in? I'm working on an implementation project at the moment, so can turn the debugging up to 11 and fix Notices, etc, as I come across them and submit again in about a week or so.

Small localised patches are better because they are much easier to review.

comment:5 @jacobsantos7 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #6669

Note: See TracTickets for help on using tickets.