Merge "Make assertFileContains not create files by default"
[lhc/web/wiklou.git] / includes / Linker.php
index 7e56522..c0959bf 100644 (file)
@@ -1212,7 +1212,8 @@ class Linker {
         * @param string|null $wikiId Id of the wiki to link to (if not the local wiki),
         *  as used by WikiMap.
         *
-        * @return string
+        * @return string HTML
+        * @return-taint onlysafefor_html
         */
        public static function formatLinksInComment(
                $comment, $title = null, $local = false, $wikiId = null
@@ -1220,6 +1221,7 @@ class Linker {
                return preg_replace_callback(
                        '/
                                \[\[
+                               \s*+ # ignore leading whitespace, the *+ quantifier disallows backtracking
                                :? # ignore optional leading colon
                                ([^\]|]+) # 1. link target; page names cannot include ] or |
                                (?:\|