diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 934e7b9..e0740ad 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -877,40 +877,17 @@ function html_parse($text) { } else { $target=' '; } - // regular expressions that will be applied to every word in the text - $regexp_replace=array( - 'http://((\.*([-a-z0-9_/~@?=%#;+]|&)+)+)' => - 'http://\1', - '(www\.[-a-z]+\.(de|pl|cz|sk|tk|tv|cc|cx|biz|us|uk|info|int|eu|dk|org|net|at|ch|com))' => - '\1', - 'https://([-a-z0-9_./~@?=%#&;\n]+)' => - 'https://\1', - 'gopher://([-a-z0-9_./~@?=%\n]+)' => - 'gopher://\1', - 'news://([-a-z0-9_./~@?=%\n]+)' => - 'news://\1', - 'ftp://([-a-z0-9_./~@?=%\n]+)' => - 'ftp://\1', - //'([-a-z0-9_./n]+)@([-a-z0-9_.]+)' => - // $_SESSION["loggedin"]!==true ? '(e-Mail)' : - // '\1@\2' - ); $ntext=""; // split every line into it's words $words=explode(" ",$text); $n=count($words); for($i=0; $i<$n; $i++) { $word=$words[$i]; - // test, if we need the slow walk through all the regular expressions - if(preg_match('/www|\:|@/i',$word)) { - // apply the regular expressions to the word until a matching - // expression is found - foreach ($regexp_replace as $key => $value) { - $nword=preg_replace('/{$key}/i',$value,$word); - if($nword!=$word) { - $word=$nword; - break; - } + if(preg_match('/https?\:\/\/[^\",]+/i', $word)) { + $nlink = preg_replace('/(\<|\>);/', '', $word); + $nword = ''.$word.''; + if($nword!=$word) { + $word=$nword; } } // add the spaces between the words