restructuring producer startpage
[mir.git] / source / mir / misc / StringUtil.java
index e226c06..191c011 100755 (executable)
@@ -450,10 +450,10 @@ public final class StringUtil {
           continue;
         }
         //has to be the last
-        if( s.indexOf( "&", i ) == i ) {
-          buf.append( "&" ); i += 0;
-          continue;
-        }
+        //if( s.indexOf( "&", i ) == i ) {
+        //  buf.append( "&" ); i += 0;
+        //  continue;
+        //}
       }
       // convert umlauts an other special charakters
       switch( s.charAt(i) ) {
@@ -867,8 +867,10 @@ public final class StringUtil {
    */
   public static String createURLLinks(String haystack) {
     try {
+
       //dieser Ausdruck brauch dringend fachliche Beratung
-      RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/([^ \t\r\n<>]+[^ \t\r\n.,<>])");
+      //RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_:-]+)/([^ \t\r\n<>)]+[^ \t\r\n,<>])");
+      RE regex = new RE("((https://)|(http://)|(ftp://)){1}([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>\\)\\]]+[^ \t\r\n.,<>\\)\\]])");
       return regex.substituteAll(haystack,"<a href=\"$0\">$0</a>");
     } catch(REException ex){
       return null;
@@ -887,7 +889,8 @@ public final class StringUtil {
   public static String createURLLinks(String haystack, String title, String imageRoot,String extImage) {
     try {
       //dieser Ausdruck brauch dringend fachliche Beratung
-      RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>]+[^ \t\r\n.,<>])");
+      RE regex = new RE("((https://)|(http://)|(ftp://)){1}([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>\\)\\]]+[^ \t\r\n.,<>\\)\\]])");
+
       if (title == null) {
         return regex.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/>&#160;<a href=\"$0\">$0</a>");
       } else {