Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#35034 closed defect (bug) (invalid)

Handling undefined index notices in wp_old_slug_redirect

Reported by: nirajkvinit's profile nirajkvinit Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

Following variables $wp_query->query_vars['name'], $wp_query->query_vars['year'], $wp_query->query_vars['monthnum'], and $wp_query->query_vars['day'] in the function wp_old_slug_redirect should be checked with isset. Else undefined index notices may arise.

Change History (3)

#1 follow-up: @swissspidy
8 years ago

  • Version 4.4 deleted

Under what circumstances are these values not set?

Using $wp_query->get( 'name' ) should suffice, as this function already does an isset check.

#2 in reply to: ↑ 1 @nirajkvinit
8 years ago

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

Replying to swissspidy:

Under what circumstances are these values not set?

Using $wp_query->get( 'name' ) should suffice, as this function already does an isset check.

You are correct! In my virtual pages, I faced this issue. Setting up query vars solved the issue! :p

#3 @swissspidy
8 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.