Index: ApiFormatBase.php
===================================================================
--- ApiFormatBase.php	(revision 39584)
+++ ApiFormatBase.php	(working copy)
@@ -192,15 +192,17 @@
 	* This method also replaces any '<' with &lt;
 	*/
 	protected function formatHTML($text) {
+		global $wgUrlProtocols;
+		
 		// Escape everything first for full coverage
 		$text = htmlspecialchars($text);
 
 		// encode all comments or tags as safe blue strings
 		$text = preg_replace('/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text);
 		// identify URLs
-		$protos = "http|https|ftp|gopher";
+		$protos = implode("|", $wgUrlProtocols);
 		# This regex hacks around bug 13218 (&quot; included in the URL)
-		$text = preg_replace("#(($protos)://.*?)(&quot;)?([ \\'\"()<\n])#", '<a href="\\1">\\1</a>\\3\\4', $text);
+		$text = preg_replace("#(($protos).*?)(&quot;)?([ \\'\"()<\n])#", '<a href="\\1">\\1</a>\\3\\4', $text);
 		// identify requests to api.php
 		$text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '<a href="\\0">\\0</a>', $text);
 		if( $this->mHelp ) {
