Make WordPress Core

Opened 12 years ago

Last modified 5 years ago

#20352 new enhancement

Use str_getcsv() to parse search terms in WP_Query

Reported by: scribu's profile scribu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch needs-refresh needs-unit-tests
Focuses: Cc:

Description (last modified by scribu)

We use an ugly regex to split search terms like these:

term1 term2 "exact match"

We could use str_getcsv() instead, for better readability.

Attachments (1)

20352.diff (1.7 KB) - added by scribu 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @scribu
12 years ago

kurtpayne mentioned in IRC a PHP 5.2 implementation for str_getcsv():

#2 @scribu
12 years ago

  • Description modified (diff)

12 years ago

#3 @scribu
12 years ago

  • Keywords has-patch added

First pass.

#4 @kurtpayne
12 years ago

  • Cc kpayne@… added

#5 @nacin
11 years ago

  • Component changed from General to Query

#6 @wonderboymusic
10 years ago

  • Keywords needs-refresh needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

Not sure this is the best solution, but we should consider something less nasty

#7 @chriscct7
9 years ago

  • Severity changed from minor to normal
Note: See TracTickets for help on using tickets.