From 5467607fe1ab31b4651d39268695b3eb15e9015f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 18 Jan 2008 22:41:38 +0100 Subject: try to warn about pcre.backtrack_limit errors FS#1258 darcs-hash:20080118214138-7ad00-86962cd0413db95ea19383c4579b3240ad3c4301.gz --- inc/parser/lexer.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'inc/parser/lexer.php') diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php index 88deb7fe9..cf892e0bc 100644 --- a/inc/parser/lexer.php +++ b/inc/parser/lexer.php @@ -113,6 +113,11 @@ class Doku_LexerParallelRegex { } if (! preg_match($this->_getCompoundedRegex(), $subject, $matches)) { + if(function_exists('preg_last_error')){ + $err = preg_last_error(); + if($err == 2) msg('A PCRE backtrack error occured. Try to increase the pcre.backtrack_limit in php.ini',-1); + } + $split = array($subject, "", ""); return false; } -- cgit v1.2.3