From d35ab615a0b98711390d39009e1a10a4edacfa9a Mon Sep 17 00:00:00 2001 From: "henning.noren" Date: Thu, 4 Jan 2007 20:49:53 +0100 Subject: UNDO: regex_simpler.patch Replaces some simple regular expressions with standard (faster) string functions darcs-hash:20070104194953-d2a3e-8fd0c89812277467c5bce566dfc3fba6ce1c3981.gz --- inc/parser/handler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/handler.php b/inc/parser/handler.php index ae9d76912..a5d07a07a 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -585,9 +585,9 @@ class Doku_Handler { case DOKU_LEXER_MATCHED: if ( $match == ' ' ){ $this->_addCall('cdata', array($match), $pos); - } else if ( strpos('\t',$match) !== false ) { + } else if ( preg_match('/\t+/',$match) ) { $this->_addCall('table_align', array($match), $pos); - } else if ( strpos(' ',$match) !== false ) { + } else if ( preg_match('/ {2,}/',$match) ) { $this->_addCall('table_align', array($match), $pos); } else if ( $match == "\n|" ) { $this->_addCall('table_row', array(), $pos); @@ -659,9 +659,9 @@ function Doku_Handler_Parse_Media($match) { } //get linking command - if(stripos('nolink',$param) !== false){ + if(preg_match('/nolink/i',$param)){ $linking = 'nolink'; - }else if(stripos('direct',$param) !== false){ + }else if(preg_match('/direct/i',$param)){ $linking = 'direct'; }else{ $linking = 'details'; -- cgit v1.2.3