Skip to content

Commit ba8ce4a

Browse files
committed
Increase the overly conservative pcre backtrack limit from 100000 to 1000000
1 parent f7e6e6c commit ba8ce4a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PHP NEWS
33
?? ??? 2011, PHP 5.3.7
44
- Upgraded bundled SQLite to version 3.7.6.2. (Scott)
55
- Upgraded bundled PCRE to version 8.12. (Scott)
6+
- Increased the backtrack limit from 100000 to 1000000 (Rasmus)
67

78
- Zend Engine:
89
. Fixed bug #54804 (__halt_compiler and imported namespaces).

ext/pcre/php_pcre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static PHP_GSHUTDOWN_FUNCTION(pcre) /* {{{ */
115115
/* }}} */
116116

117117
PHP_INI_BEGIN()
118-
STD_PHP_INI_ENTRY("pcre.backtrack_limit", "100000", PHP_INI_ALL, OnUpdateLong, backtrack_limit, zend_pcre_globals, pcre_globals)
118+
STD_PHP_INI_ENTRY("pcre.backtrack_limit", "1000000", PHP_INI_ALL, OnUpdateLong, backtrack_limit, zend_pcre_globals, pcre_globals)
119119
STD_PHP_INI_ENTRY("pcre.recursion_limit", "100000", PHP_INI_ALL, OnUpdateLong, recursion_limit, zend_pcre_globals, pcre_globals)
120120
PHP_INI_END()
121121

ext/standard/tests/general_functions/ini_get_all.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
ini_get_all() tests
33
--INI--
4-
pcre.backtrack_limit=100000
4+
pcre.backtrack_limit=1000000
55
pcre.recursion_limit=100000
66
--SKIPIF--
77
<?php if (!extension_loaded("reflection")) die("skip"); ?>
@@ -34,9 +34,9 @@ array(2) {
3434
["pcre.backtrack_limit"]=>
3535
array(3) {
3636
["global_value"]=>
37-
string(6) "100000"
37+
string(6) "1000000"
3838
["local_value"]=>
39-
string(6) "100000"
39+
string(6) "1000000"
4040
["access"]=>
4141
int(7)
4242
}
@@ -52,7 +52,7 @@ array(2) {
5252
}
5353
array(2) {
5454
["pcre.backtrack_limit"]=>
55-
string(6) "100000"
55+
string(6) "1000000"
5656
["pcre.recursion_limit"]=>
5757
string(6) "100000"
5858
}

0 commit comments

Comments
 (0)