summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-03-19 20:53:45 +0100
committerAndreas Gohr <andi@splitbrain.org>2008-03-19 20:53:45 +0100
commit92bcfa2abd28df99c56547421200f218edcb4b68 (patch)
tree70836ce0b6971052f8e7ac9405b2708bbc65db75 /inc/parser
parent1775272d5c09cf755dc3bcc9f40521a82ff7cce1 (diff)
downloadrpg-92bcfa2abd28df99c56547421200f218edcb4b68.tar.gz
rpg-92bcfa2abd28df99c56547421200f218edcb4b68.tar.bz2
completed PCRE error checking in lexer
darcs-hash:20080319195345-7ad00-2def5dffd099cfb13863f73122821dc2e48b9b1b.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/lexer.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php
index cf892e0bc..375f9e5f9 100644
--- a/inc/parser/lexer.php
+++ b/inc/parser/lexer.php
@@ -115,7 +115,20 @@ 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);
+ switch($err){
+ case PREG_BACKTRACK_LIMIT_ERROR:
+ msg('A PCRE backtrack error occured. Try to increase the pcre.backtrack_limit in php.ini',-1);
+ break;
+ case PREG_RECURSION_LIMIT_ERROR:
+ msg('A PCRE recursion error occured. Try to increase the pcre.recursion_limit in php.ini',-1);
+ break;
+ case PREG_BAD_UTF8_ERROR:
+ msg('A PCRE UTF-8 error occured. This might be caused by a faulty plugin',-1);
+ break;
+ case PREG_INTERNAL_ERROR:
+ msg('A PCRE internal error occured. This might be caused by a faulty plugin',-1);
+ break;
+ }
}
$split = array($subject, "", "");