Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#25895 closed defect (bug) (fixed)

get_search_stopwords : undefined var

Reported by: tivnet's profile tivnet Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 3.8 Priority: normal
Severity: normal Version: 3.7
Component: Query Keywords: has-patch commit
Focuses: Cc:

Description

If translators decide to have an empty list of stopwords, there will be an undefined variable warning, because $stopwords was not initialized before the loop

Added $stopwords = array(); before the loop.

Attachments (1)

get_search_stopwords--undefined-var.patch (620 bytes) - added by tivnet 11 years ago.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.7.2
  • Version changed from 3.7.1 to 3.7

#2 @SergeyBiryukov
11 years ago

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

In 26060:

Declare the variable before using it. props tivnet. fixes #25895 for trunk.

#3 @SergeyBiryukov
11 years ago

  • Keywords commit fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

#4 @dd32
11 years ago

I don't personally think a PHP Notice warrants a point release.

#5 follow-up: @nacin
11 years ago

I think this would actually end up being an E_WARNING, due to in_array() not receiving an array.

#6 in reply to: ↑ 5 @SergeyBiryukov
11 years ago

Replying to nacin:

I think this would actually end up being an E_WARNING, due to in_array() not receiving an array.

Correct:

Notice: Undefined variable: stopwords in wp-includes/query.php on line 2033
Warning: in_array() [function.in-array]: Wrong datatype for second argument in wp-includes/query.php on line 1993

#7 @nacin
11 years ago

  • Component changed from General to Query

#8 @nacin
11 years ago

  • Keywords fixed-major removed
  • Milestone changed from 3.7.2 to 3.8
  • Resolution set to fixed
  • Status changed from reopened to closed

Moving to 3.8 and calling this fixed.

Note: See TracTickets for help on using tickets.