Page MenuHomePhabricator

Installer should check for PCRE compile time option PCRE_CONFIG_NEWLINE
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • when compiling php, compile it against a version of PCRE that has build time option PCRE_CONFIG_NEWLINE set to -1 (any)
  • visit a page like talk:ą and note how its in the wrong namespace. This is especially noticible in special pages in polish.

What happens?:
*Any page with a unicode character that has 0x85 in its utf-8 representation is misidentified. I believe this is due to PCRE_CONFIG_NEWLINE causing it to be considered a line ending character

What should have happened instead?:

  • we should treat 0x85 as a normal character.
  • we should prevent installation if we detect this configuration

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

Allegedly this happens on openbsd's php package.

See also https://www.mediawiki.org/wiki/Topic:Wrdkyaid33xitqz2

Event Timeline

Hi, I would like try my hand at this? Can you provide a little bit more details of where this needs to be changed in the codebase?

So we want to add a new env check for this. The existing ones are here https://github.com/wikimedia/mediawiki/blob/master/includes/installer/Installer.php#L137 we probably also have to add appropriate i18n messages.

The check should probably just run a preg_match to see if ą is considered a newline. Something like checking if "bąc" matches /^b.*c$/ or something along those lines.

Let me know if you need more details.

Change 772043 had a related patch set uploaded (by Martin Vega-Leal; author: Martin Vega-Leal):

[mediawiki/core@master] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/772043

Change 772043 merged by jenkins-bot:

[mediawiki/core@master] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/772043

Change 774389 had a related patch set uploaded (by Reedy; author: Martin Vega-Leal):

[mediawiki/core@REL1_38] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774389

Change 774390 had a related patch set uploaded (by Reedy; author: Martin Vega-Leal):

[mediawiki/core@REL1_37] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774390

Change 774391 had a related patch set uploaded (by Reedy; author: Martin Vega-Leal):

[mediawiki/core@REL1_36] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774391

Change 774392 had a related patch set uploaded (by Reedy; author: Martin Vega-Leal):

[mediawiki/core@REL1_35] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774392

Change 774389 merged by jenkins-bot:

[mediawiki/core@REL1_38] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774389

Change 774392 merged by jenkins-bot:

[mediawiki/core@REL1_35] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774392

Change 774390 merged by jenkins-bot:

[mediawiki/core@REL1_37] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774390

Change 774391 merged by jenkins-bot:

[mediawiki/core@REL1_36] Installer: Check correct PCRE_CONFIG_NEWLINE

https://gerrit.wikimedia.org/r/774391

Krinkle claimed this task.
Krinkle reassigned this task from Krinkle to martinvega.
Krinkle subscribed.