diff options
author | henning.noren <henning.noren@gmail.com> | 2007-01-04 20:49:53 +0100 |
---|---|---|
committer | henning.noren <henning.noren@gmail.com> | 2007-01-04 20:49:53 +0100 |
commit | 3edf3f08f268af55c6ac824af774ccec19b893f4 (patch) | |
tree | ab39f0a9d60afc057635bf5876dc123843c61c68 | |
parent | 44881bd0f492e789063188af34111af4b4117028 (diff) | |
download | rpg-3edf3f08f268af55c6ac824af774ccec19b893f4.tar.gz rpg-3edf3f08f268af55c6ac824af774ccec19b893f4.tar.bz2 |
regex_simpler.patch
Replaces some simple regular expressions with standard (faster) string functions
darcs-hash:20070104194953-d2a3e-0b06e7a599a0177ad37a54497074893572e1cae2.gz
-rw-r--r-- | inc/common.php | 2 | ||||
-rw-r--r-- | inc/parser/handler.php | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/inc/common.php b/inc/common.php index 60bec57a2..21dea4d5f 100644 --- a/inc/common.php +++ b/inc/common.php @@ -614,7 +614,7 @@ function cleanText($text){ * @author Andreas Gohr <andi@splitbrain.org> */ function formText($text){ - $text = preg_replace("/\012/","\015\012",$text); + $text = str_replace("\012","\015\012",$text); return htmlspecialchars($text); } diff --git a/inc/parser/handler.php b/inc/parser/handler.php index a5d07a07a..ae9d76912 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 ( preg_match('/\t+/',$match) ) { + } else if ( strpos('\t',$match) !== false ) { $this->_addCall('table_align', array($match), $pos); - } else if ( preg_match('/ {2,}/',$match) ) { + } else if ( strpos(' ',$match) !== false ) { $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(preg_match('/nolink/i',$param)){ + if(stripos('nolink',$param) !== false){ $linking = 'nolink'; - }else if(preg_match('/direct/i',$param)){ + }else if(stripos('direct',$param) !== false){ $linking = 'direct'; }else{ $linking = 'details'; |