]> git.mjollnir.org Git - moodle.git/commitdiff
Add spaces for web addresses to help bodgy clients that get
authormoodler <moodler>
Tue, 17 Aug 2004 08:09:13 +0000 (08:09 +0000)
committermoodler <moodler>
Tue, 17 Aug 2004 08:09:13 +0000 (08:09 +0000)
confused about the trailing ] bracket.

bug 1649

lib/weblib.php

index edc687d18198a714c65575600b64f8fa0ba0d42f..ba9a31bfa9380b39fd61d5ff5ab5c3079e4ffe17 100644 (file)
@@ -684,7 +684,7 @@ function format_text_email($text, $format) {
             $text = wiki_to_html($text);
         /// This expression turns links into something nice in a text format. (Russell Jungwirth)
         /// From: http://php.net/manual/en/function.eregi-replace.php and simplified
-            $text = eregi_replace('(<a [^<]*href=["|\']?([^ "\']*)["|\']?[^>]*>([^<]*)</a>)','\\3 [\\2]', $text);
+            $text = eregi_replace('(<a [^<]*href=["|\']?([^ "\']*)["|\']?[^>]*>([^<]*)</a>)','\\3 [ \\2 ]', $text);
             return strtr(strip_tags($text), array_flip(get_html_translation_table(HTML_ENTITIES)));
             break;
 
@@ -695,7 +695,7 @@ function format_text_email($text, $format) {
         case FORMAT_MOODLE:
         case FORMAT_MARKDOWN:
         default: 
-            $text = eregi_replace('(<a [^<]*href=["|\']?([^ "\']*)["|\']?[^>]*>([^<]*)</a>)','\\3 [\\2]', $text);
+            $text = eregi_replace('(<a [^<]*href=["|\']?([^ "\']*)["|\']?[^>]*>([^<]*)</a>)','\\3 [ \\2 ]', $text);
             return strtr(strip_tags($text), array_flip(get_html_translation_table(HTML_ENTITIES)));
             break;
     }