RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1434486 - PCRE 7.8 fails to recognize non-ASCII printable characters
Summary: PCRE 7.8 fails to recognize non-ASCII printable characters
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pcre
Version: 6.9
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Petr Pisar
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-21 15:32 UTC by Martin Kyral
Modified: 2017-03-22 09:38 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1400267
Environment:
Last Closed: 2017-03-22 09:37:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kyral 2017-03-21 15:32:17 UTC
+++ This bug was initially created as a clone of Bug #1400267 +++
Happens on RHEL 6 with pcre-7.8-7.el6.x86_64 as well.

Description of problem:
preg_replace with unicode modifier in PHP 7.0.13 with PCRE 8.32 (from Centos 7 updates repo) does not work as expected in the below use case. 

Version-Release number of selected component (if applicable):
PHP 7.0.13 has been installed from cPanel (http://www.cpanel.com/) EasyApache 4 (ea-php70-7.0.13-1.1.1.cpanel.x86_64)

# php --version
PHP 7.0.13 (cli) (built: Nov 14 2016 15:24:31) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.4, Copyright (c) 2002-2016, by ionCube Ltd.

# yum info pcre-devel
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 85.13.201.2
 * base: mirror.vorboss.net
 * extras: mirror.vorboss.net
 * updates: mirror.vorboss.net
Installed Packages
Name        : pcre-devel
Arch        : x86_64
Version     : 8.32
Release     : 15.el7_2.1
Size        : 1.4 M
Repo        : installed
From repo   : updates
Summary     : Development files for pcre
URL         : http://www.pcre.org/
Licence     : BSD
Description : Development files (Headers, libraries for dynamic linking, etc)
            : for pcre.

How reproducible:
Always - 100%

Steps to Reproduce:
1. php -r "var_dump(preg_replace('/[\\x{0000}\\x{200B}-\\x{200D}\\x{FEFF}]|\\r?\\n|\\r/u', '', 'test'));"

Actual results:
string(0) ""

Expected results:
string(4) "test"

Additional info:

--- Additional comment from Remi Collet on 2016-11-30 13:53:47 EST ---

Notice: rh-php70 packages in RHSCL 2.3 are also affected.

Another example, run using RHEL / RHSCL official packages:

$ php -r "var_dump(PHP_VERSION, preg_replace('/[^[:print:]]/u', '', 'ČEZ'));"
string(6) "5.4.16"
string(2) "EZ"

$ scl enable rh-php56 bash
$ php -r "var_dump(PHP_VERSION, preg_replace('/[^[:print:]]/u', '', 'ČEZ'));"
string(6) "5.6.25"
string(2) "EZ"

$ scl enable rh-php70 bash
$ php -r "var_dump(PHP_VERSION, preg_replace('/[^[:print:]]/u', '', 'ČEZ'));"
string(6) "7.0.10"
string(2) "EZ"

While with fedora package (pcre 8.39):

$ php -r "var_dump(PHP_VERSION, preg_replace('/[^[:print:]]/u', '', 'ČEZ'));"
string(6) "7.0.13"
string(4) "ČEZ"

Comment 1 Petr Pisar 2017-03-22 09:37:27 UTC
pcre-7.8-7.el6 does cannot match it because UCP matching mode was added in PCRE 8.10. (And then the [:print:] class was adjusted in UCP mode only.) pcretest reports the unknown UCP mode switch (/W):

$ printf '/[[:print:]]/8W\nČ\n' | pcretest
PCRE version 7.8 2008-09-05

  re> ** Unknown option 'W'
  re>     > ** Unexpected EOF

Without the /W option, RHEL-6 pcre package behaves in accordance with RHEL-7 and upstream code.

And even if that was not the case I don't think changing the behavior in this RHEL-6 late period would be appropriate.

I'm not going to "fix" it.


Note You need to log in before you can comment on or make changes to this bug.