Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Zend\Http\Header\SetCookie not compatible with older versions of pcre (and therefore CentOS) #5423

Merged
merged 1 commit into from

3 participants

@rurri

SetCookie no longer compiles with older versions of PCRE as of 2.2.5.

This appears to be the same issue addressed in the Console Router in an earlier version.

#4134


Version 6.x of PCRE does not recognize ?< as a valid preg_match command.

It DOES recognize ?P<

From http://php.net/manual/en/function.preg-match.php:
"Named subpatterns now accept the syntax (?) and (?'name') as well as (?P). Previous versions accepted only (?P)."

@Maks3w Maks3w was assigned
@Maks3w Maks3w merged commit e4402ed into zendframework:master
@ThaDafinser ThaDafinser referenced this pull request from a commit in ThaDafinser/zf2
@weierophinney weierophinney [#5423] Fix preg_match to work with older PCRE versions
- Use `?P<...>`, not `?<...>`
d39fe60
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-http
@weierophinney weierophinney [zendframework/zf2#5423] Fix preg_match to work with older PCRE versions
- Use `?P<...>`, not `?<...>`
49b5c68
@gianarb gianarb referenced this pull request from a commit in zendframework/zend-http
@Maks3w Maks3w Merge pull request zendframework/zf2#5423 0b1476d
@gianarb gianarb referenced this pull request from a commit in zendframework/zend-http
@Maks3w Maks3w Merge pull request zendframework/zf2#5423 in develop 9a10360
@gianarb gianarb referenced this pull request from a commit in zendframework/zend-http
@Maks3w Maks3w Merge pull request zendframework/zf2#5423 in master d6e6fdc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 6, 2013
  1. @weierophinney

    [#5423] Fix preg_match to work with older PCRE versions

    weierophinney authored
    - Use `?P<...>`, not `?<...>`
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −2  library/Zend/Http/Header/SetCookie.php
View
3  library/Zend/Http/Header/SetCookie.php
@@ -97,7 +97,6 @@ class SetCookie implements MultipleHeaderInterface
*/
public static function fromString($headerLine, $bypassHeaderFieldName = false)
{
- /* @var $setCookieProcessor Closure */
static $setCookieProcessor = null;
if ($setCookieProcessor === null) {
@@ -107,7 +106,7 @@ public static function fromString($headerLine, $bypassHeaderFieldName = false)
$keyValuePairs = preg_split('#;\s*#', $headerLine);
foreach ($keyValuePairs as $keyValue) {
- if (preg_match('#^(?<headerKey>[^=]+)=\s*("?)(?<headerValue>[^"]+)\2#',$keyValue,$matches)) {
+ if (preg_match('#^(?P<headerKey>[^=]+)=\s*("?)(?P<headerValue>[^"]+)\2#', $keyValue, $matches)) {
$headerKey = $matches['headerKey'];
$headerValue= $matches['headerValue'];
} else {
Something went wrong with that request. Please try again.