diff --git a/html/inc/text_transform.inc b/html/inc/text_transform.inc index be1547111c..e668e63c37 100644 --- a/html/inc/text_transform.inc +++ b/html/inc/text_transform.inc @@ -153,6 +153,22 @@ function replace_pre_code($text, $export) { function bb2html($text, $export=false) { $urlregex = "(?:\"?)(?:(http\:\/\/)?)([^\[\"<\ ]+)(?:\"?)"; + // NOTE: + // This matches https:// too; I don't understand why. + // sample results: + // Array + // ( + // [0] => [img]https://a.b.c[/img] + // [1] => + // [2] => https://a.b.c + // ) + // Array + // ( + // [0] => [img]http://a.b.c[/img] + // [1] => http:// + // [2] => a.b.c + // ) + $httpsregex = "(?:\"?)https\:\/\/([^\[\"<\ ]+)(?:\"?)"; // List of allowable tags $bbtags = array ( @@ -203,7 +219,7 @@ function bb2html($text, $export=false) { "
\\1", "
", "
", - " ", + " ", "\\2", "\\1
\\1", "
", "
", - " ", + " ", "\\2", "\\1