#43109 closed defect (bug) (fixed)
RegEx in parse_db_host() can cause notices and headers sent too early
Reported by: | gallerycy | Owned by: | dd32 |
---|---|---|---|
Milestone: | 4.9.3 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Database | Keywords: | |
Focuses: | Cc: |
Description
WP have installed this update and I am now unable to access the dashboard - please can you help? The site is gallerycy.com
Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/user53852/website/wp-includes/wp-db.php on line 1657
Warning: Cannot modify header information - headers already sent by (output started at /web1/user53852/website/wp-includes/wp-db.php:1657) in /web1/user53852/website/wp-includes/pluggable.php on line 1216
Change History (9)
#1
@
7 years ago
- Component changed from General to Database
- Summary changed from WP 4.9.2 to RegEx in parse_db_host() can cause notices and headers sent too early
- Version changed from 4.9.2 to 4.9
#3
@
7 years ago
- Milestone changed from Awaiting Review to 4.9.4
I'm going to milestone this to a 4.9.x, It sounds like something we can easily work around, so we might as well do it.
This ticket was mentioned in Slack in #core by dd32. View the logs.
7 years ago
#5
@
7 years ago
PHP=5.3.3 from CentOS 5.11 which means it is not exactly 5.3.3 but something like that (with security patches)
Using 5.4.45 on the same set up the warning disappears.
Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in .../wp-includes/wp-db.php on line 1657
#7
@
7 years ago
- Owner set to dd32
- Status changed from new to accepted
From https://www.pcre.org/original/changelog.txt
PCRE Version 4.0 (17-Feb-2003) added (?P<name>..)
syntax.
PCRE Version 7.0 (19-Dec-2006) added (?<name>..)
syntax.
Lets just update it to the first syntax, an extra character isn't going to cause harm :)
Hi there, and welcome to WordPress Trac!
Some quick digging shows that this has happened to a few people after 4.9 introduced a new function, would you be able to share some more information with us about your setup, most notably what version of PHP you are using and if you know it, is it a Windows or linux based host?
For reference, this relates to the
parse_db_host()
function and the RegEx used there to split up hosts and ports.There's been some digging on the forums, and is likely caused by outdated PCRE libraries, we can work around this by using a slightly different syntax it seems (See Otto's comment)