summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class4
-rwxr-xr-xtests/it.t5
2 files changed, 7 insertions, 2 deletions
diff --git a/it.class b/it.class
index 371d9e4..69626bb 100644
--- a/it.class
+++ b/it.class
@@ -350,7 +350,7 @@ static function convertregex($pattern, $p = array())
*/
static function match($pattern, $string, $p = null)
{
- if (!preg_match('/\\\\[wb]|[!\x80-\xff]/i', $pattern) && !$p)
+ if (!preg_match('/\\\\[wb]|[!\x80-\xff]|\[\[:/i', $pattern) && !$p)
$r = preg_match('!' . $pattern . '!i', $string, $m); # fast path for simple patterns
else
{
@@ -369,7 +369,7 @@ static function match($pattern, $string, $p = null)
if (!$r) # no match
{
- if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) # Silence phpversionlint.php commit hook: function_exists('preg_last_error')
+ if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR)
it::error("Exceeded pcre.backtrack_limit of " . ini_get('pcre.backtrack_limit') . " bytes");
$result = $p['all'] ? array() : null;
diff --git a/tests/it.t b/tests/it.t
index 22fd194..c356ad0 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -75,6 +75,11 @@ match(
'include umlaute in \w'
);
match(
+ '[[:alpha:]]+', ' |#blahä ',
+ 'blahä',
+ 'include umlaute in \w'
+ );
+match(
'\W+', ' |#Üblahä ',
' |#',
'don\'t include umlaute in \W'