WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 19 months ago

#13413 closed defect (bug) (worksforme)

Querying Taxonomies (Tag) containing the sequence "-נ-" fails.

Reported by: hakre Owned by: scribu
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Query Keywords: has-patch needs-refresh
Focuses: Cc:

Description

Fresh from Beta testing latest trunk:

1.) Created a Tag "test -נ- end"

2.) Added the Tag to a Post

3.) Pressed that Tag in my Tag Cloud

4.) Get the not Found Message.

Attachments (3)

13413.patch (8.4 KB) - added by hakre 4 years ago.
13413.2.patch (1.3 KB) - added by hakre 4 years ago.
Minified Patch
13413.diff (1.6 KB) - added by wojtek.szkutnik 4 years ago.

Download all attachments as: .zip

Change History (27)

comment:1 nacin4 years ago

Is this not an obvious duplicate of #11669?

comment:2 hakre4 years ago

This went through, related tickets were:

#11669, #11724

#11669 is not a duplicate because that is 2.9 and cutting names. The tag now works while creating it. This time it is about querying all pages with that tag I guess. I dunno where that 404 actually comes from. That needs to be investigated further.

#11724 might be the exact same thing, but I'm not sure.

comment:3 dd324 years ago

Is this a regression from 2.9?

comment:4 ryan4 years ago

I cut-and-paste that text and couldn't reproduce in 2.9 or 3.0, for what it's worth.

comment:5 follow-up: ocean904 years ago

I could reproduce it in 3.0 and 2.9 on my local install (windows, xampp) but not on my server install.

comment:6 ryan4 years ago

  • Milestone changed from 3.0 to 3.1

If it's not a regression in 3.0 then let's move it to 3.1. There are similar tickets we can take care of at the same time.

comment:7 in reply to: ↑ 5 hakre4 years ago

Replying to ocean90:

I could reproduce it in 3.0 and 2.9 on my local install (windows, xampp) but not on my server install.

Good you wrote that, my report is based on windows as well.

comment:8 hakre4 years ago

  • Keywords reporter-feedback added

comment:9 hakre4 years ago

Related: #14292

comment:10 hakre4 years ago

Related: #14313

hakre4 years ago

comment:11 hakre4 years ago

I was able to fix the problem with the patch. The cause is that the regex used does not properly handle UTF-8 encoded strings. The \s character class is causing this again (see [12501]). Will scan core for more of these.

comment:12 hakre4 years ago

Scan finished, core has more places where \s is used on UTF-8 strings.

hakre4 years ago

Minified Patch

comment:13 hakre4 years ago

I reduced the code changes to the bare minimum. The first patch contains some code cleanups and on function did return a reference which was not necessary because the return value was an array.

comment:14 wojtek.szkutnik4 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing gsoc added; reporter-feedback removed

I think you missed one ;)

wojtek.szkutnik4 years ago

comment:15 hakre4 years ago

Right, my patch did not focus on author. Had you run a test for authors?

comment:16 hakre3 years ago

  • Keywords needs-testing gsoc removed

Still looks good for 3.1 in my eyes.

comment:17 scribu3 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Triage to 3.1

comment:18 scribu3 years ago

  • Owner set to scribu
  • Status changed from new to accepted

comment:19 ryan3 years ago

  • Milestone changed from 3.1 to Awaiting Review

comment:20 westi3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from accepted to closed

Tested in trunk and this works fine for me.

comment:21 hakre3 years ago

Could not reproduce with trunk any longer:

Worked with PHP 5.2.14 (cli) (built: Jul 27 2010 10:43:58) on win 32.

Tried to get PHP 4 running to check if it's related to an older version (I remember it's a windows specific bug and I smell/assume this is related to some pcre lib version) but was not able to get PHP 4 running any longer and didn't want to downgrade PHP 5.2.

X-Ref: #16765

comment:23 SergeyBiryukov20 months ago

  • Component changed from General to Query

comment:24 nacin19 months ago

In [21862]:

Split tag names by [\r\n\t ] rather than \s to avoid that character class from eating characters. props rstern, SergeyBiryukov. fixes #21779. see #13413.

Note: See TracTickets for help on using tickets.