Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#25895 closed defect (bug) (fixed)

get_search_stopwords : undefined var

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

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 13 years ago.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
13 years ago

  • Milestone Awaiting Review → 3.7.2
  • Version 3.7.1 → 3.7

#2 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 26060:

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

#3 @SergeyBiryukov
13 years ago

  • Keywords commit fixed-major added
  • Resolution fixed
  • Status closed → reopened

#4 @dd32
13 years ago

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

#5 follow-up: @nacin
13 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
13 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
13 years ago

  • Component General → Query

#8 @nacin
13 years ago

  • Keywords fixed-major removed
  • Milestone 3.7.2 → 3.8
  • Resolution → fixed
  • Status reopened → closed

Moving to 3.8 and calling this fixed.

Note: See TracTickets for help on using tickets.