Improve in-line documentation of $wgUrlProtocols; add 'redis://'
authorOri Livneh <ori@wikimedia.org>
Sat, 3 May 2014 21:55:04 +0000 (14:55 -0700)
committerOri Livneh <ori@wikimedia.org>
Sat, 3 May 2014 21:55:04 +0000 (14:55 -0700)
* RedisPubSubFeedEngine uses 'redis://' URLs. So does redis-py and many other
  client libraries. It should be recognized by MediaWiki. So add it.
* Remove in-line comments justifying each individual URL scheme.
  DefaultSettings.php is long enough; it doesn't need to moonlight as
  the annals of the history of MediaWiki development.
* Make the documentation of $wgUrlProtocols a bit more useful.

Change-Id: I4c2de67cc4e243659b0bed674e0ccd48221c57f3

includes/DefaultSettings.php

index 8c96727..0ca35f0 100644 (file)
@@ -3716,36 +3716,14 @@ $wgMaxTemplateDepth = 40;
 $wgMaxPPExpandDepth = 40;
 
 /**
- * The external URL protocols
+ * URL schemes that should be recognized as valid by wfParseUrl().
+ * @see wfParseUrl
  */
 $wgUrlProtocols = array(
-       'http://',
-       'https://',
-       'ftp://',
-       'ftps://', // If we allow ftp:// we should allow the secure version.
-       'ssh://',
-       'sftp://', // SFTP > FTP
-       'irc://',
-       'ircs://', // @bug 28503
-       'xmpp:', // Another open communication protocol
-       'sip:',
-       'sips:',
-       'gopher://',
-       'telnet://', // Well if we're going to support the above.. -ævar
-       'nntp://', // @bug 3808 RFC 1738
-       'worldwind://',
-       'mailto:',
-       'tel:', // If we can make emails linkable, why not phone numbers?
-       'sms:', // Likewise this is standardized too
-       'news:',
-       'svn://',
-       'git://',
-       'mms://',
-       'bitcoin:', // Even registerProtocolHandler whitelists this along with mailto:
-       'magnet:', // No reason to reject torrents over magnet: when they're allowed over http://
-       'urn:', // Allow URNs to be used in Microdata/RDFa <link ... href="urn:...">s
-       'geo:', // urls define geo locations, they're useful in Microdata/RDFa and for coordinates
-       '//', // for protocol-relative URLs
+       'bitcoin:', 'ftp://', 'ftps://', 'geo:', 'git://', 'gopher://', 'http://',
+       'https://', 'irc://', 'ircs://', 'magnet:', 'mailto:', 'mms://', 'news:',
+       'nntp://', 'redis://', 'sftp://', 'sip:', 'sips:', 'sms:', 'ssh://',
+       'svn://', 'tel:', 'telnet://', 'urn:', 'worldwind://', 'xmpp:', '//'
 );
 
 /**