WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#35034 closed defect (bug) (invalid)

Handling undefined index notices in wp_old_slug_redirect

Reported by: nirajkvinit Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:
PR Number:

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
4 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
4 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
4 years ago

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