WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 months ago

#35534 closed defect (bug) (worksforme)

AllPosts page: search cannot be performed using characters "-" and "\" (without the quotes)

Reported by: antonrinas Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.1
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

STEPS TO REPRODUCE
1) Log in as administrator, remove all posts
2) create new post with title
aA1 ~`!@#$%&*()-_=+\|{}[]:";'<>,./?
3) Go to AllPosts page, type in the "Search" field character "-" (without the quotes), "Search Posts"
EXPECTED RESULT: 1 post was found.
ACTUAL RESULT: "No posts found."
4) type in the "Search" field character "\" (without the quotes), "Search Posts"
EXPECTED RESULT: 1 post was found.
ACTUAL RESULT: "No posts found."

Change History (1)

#1 @markparnell
4 months ago

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

I've just tested this on 5.7.1 and a search on \ now works. Search queries which contain - also work (e.g. searching for a hyphenated word), though just - on its own does not. It appears that this is because a search query that starts with - is treated as a negative query - i.e. find all posts that don't contain the subsequent string.

As such I don't believe any action is required here.

Note: See TracTickets for help on using tickets.