openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b0b3e5265faff7f8640a02fa8c6e4bb37c5d425e
parent 211723333396d2dc3cd3331bb9630284e31b475b
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 23 Sep 2016 01:26:34 +0200

Weitere Änderungen für PHP7 notwendig.

Diffstat:
textClasses/parser/WikiParser.class.php | 8++++----
util/Text.class.php | 16++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/textClasses/parser/WikiParser.class.php b/textClasses/parser/WikiParser.class.php @@ -585,20 +585,20 @@ class WikiParser function fixLinks( $text ) { // Text->... umsetzen nach "Text"->... (Anfuehrungszeichen ergaenzen) - $text = ereg_replace( '([A-Za-z0-9._-]+)\-\>','"\\1"->',$text ); + $text = preg_replace( '/([A-Za-z0-9._-]+)\-\>/','"\\1"->',$text ); // ...->Link umsetzen nach ...->"Link" (Anfuehrungszeichen ergaenzen) - $text = ereg_replace( '\->([A-Za-z0-9\.\:\_\/\,\?\=\&-]+)','->"\\1"',$text ); + $text = preg_replace( '/\->([A-Za-z0-9\.\:\_\/\,\?\=\&-]+)/','->"\\1"',$text ); // alleinstehende externe Links // Funktioniert nicht richtig, erstmal deaktiviert. // $text = ereg_replace( '((https?|ftps?|news|gopher):\/\/([A-Za-z0-9._\/\,-]+))([^"])','"\\1"->"\\1"\\2',$text ); // alleinstehende E-Mail Adressen - $text = ereg_replace( '([A-Za-z0-9._-]+@[A-Za-z0-9\.\_\-]+)([^A-Za-z0-9\.\_\-\"])','"\\1"->"mailto:\\1"\\2',$text ); + $text = preg_replace( '/([A-Za-z0-9._-]+@[A-Za-z0-9\.\_\-]+)([^A-Za-z0-9\.\_\-\"])/','"\\1"->"mailto:\\1"\\2',$text ); // Bilder - $text = ereg_replace( 'ima?ge?:\/?\/?([A-Za-z0-9\.\:\_\/\,\?\=\&-]+)','{\\1}',$text ); + $text = preg_replace( '/ima?ge?:\/?\/?([A-Za-z0-9\.\:\_\/\,\?\=\&-]+)/','{\\1}',$text ); return $text; } diff --git a/util/Text.class.php b/util/Text.class.php @@ -69,12 +69,12 @@ class Text */ function bbCode2Wiki( $inhalt ) { - $inhalt = eregi_replace('\[b\]([^\[]*)\[\/b\]' , '*\\1*' ,$inhalt); - $inhalt = eregi_replace('\[i\]([^\[]*)\[\/i\]' , '_\\1_' ,$inhalt); - $inhalt = eregi_replace('\[code\]([^\[]*)\[\/code\]' , '=\\1=' ,$inhalt); + $inhalt = preg_replace('/\[b\]([^\[]*)\[\/b\]/i' , '*\\1*' ,$inhalt); + $inhalt = preg_replace('/\[i\]([^\[]*)\[\/i\]/i' , '_\\1_' ,$inhalt); + $inhalt = preg_replace('/\[code\]([^\[]*)\[\/code\]/i' , '=\\1=' ,$inhalt); - $inhalt = eregi_replace('\[url\]([^\[]*)[\/url\]' ,'"\\1"->"\\1"' ,$inhalt); - $inhalt = eregi_replace('\[url=([^\[]*)\]([^\[]*)\[\/url\]','"\\2"->"\\1"' ,$inhalt); + $inhalt = preg_replace('/\[url\]([^\[]*)\[\/url\]/i' ,'"\\1"->"\\1"' ,$inhalt); + $inhalt = preg_replace('/\[url=([^\[]*)\]([^\[]*)\[\/url\]/i' ,'"\\2"->"\\1"' ,$inhalt); return $inhalt; } @@ -89,9 +89,9 @@ class Text */ function Html2Wiki( $inhalt ) { - $inhalt = eregi_replace('<b(.*)>(.*)</b>','*\\2*' ,$inhalt); - $inhalt = eregi_replace('<i(.*)>(.*)</i>','_\\2_' ,$inhalt); - $inhalt = eregi_replace('<a(.*)href="(.*)">(.*)</a>','"\\3"->"\\2"' ,$inhalt); + $inhalt = preg_replace('/<b(.*)>(.*)<\/b>/i','*\\2*' ,$inhalt); + $inhalt = preg_replace('/<i(.*)>(.*)<\/i>/i','_\\2_' ,$inhalt); + $inhalt = preg_replace('/<a(.*)href="(.*)">(.*)<\/a>/i','"\\3"->"\\2"' ,$inhalt); return $inhalt; }