diff options
| author | Nuno Lopes <nlopess@php.net> | 2007-10-07 13:57:10 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2007-10-07 13:57:10 +0000 |
| commit | 66a24c86a6bc9e4050cfb05e0d5c4e9bd460fdd5 (patch) | |
| tree | 2a74262e48a372b9e4dc2e34592f12febc3a7b8c | |
| parent | 51051fc8bcbac6c5731d6cb958387186bafe843c (diff) | |
| download | php-git-66a24c86a6bc9e4050cfb05e0d5c4e9bd460fdd5.tar.gz | |
Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines)
| -rw-r--r-- | NEWS | 1 | ||||
| -rw-r--r-- | ext/pcre/php_pcre.c | 2 | ||||
| -rw-r--r-- | ext/pcre/tests/bug42737.phpt | 19 |
3 files changed, 21 insertions, 1 deletions
@@ -43,6 +43,7 @@ PHP NEWS class). (Dmitry) - Fixed bug #42798 (__autoload() not triggered for classes used in method signature). (Dmitry) +- Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines). (Nuno) - Fixed bug #42657 (ini_get() returns incorrect value when default is NULL). (Jani) - Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 1984a97277..ec36ac4763 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1528,7 +1528,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec if (re_bump == NULL) { int dummy; - if ((re_bump = pcre_get_compiled_regex("/./u", &extra_bump, &dummy TSRMLS_CC)) == NULL) { + if ((re_bump = pcre_get_compiled_regex("/./us", &extra_bump, &dummy TSRMLS_CC)) == NULL) { RETURN_FALSE; } } diff --git a/ext/pcre/tests/bug42737.phpt b/ext/pcre/tests/bug42737.phpt new file mode 100644 index 0000000000..8d9dd52b31 --- /dev/null +++ b/ext/pcre/tests/bug42737.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines) +--FILE-- +<?php + +$string = chr(13).chr(10); + +$array = preg_split('//u', $string, - 1, PREG_SPLIT_NO_EMPTY); + +var_dump(array_map('ord', $array)); + +?> +--EXPECT-- +array(2) { + [0]=> + int(13) + [1]=> + int(10) +} |
