From 62b1fbd5f42818d492bd086cfa68e01dca317c64 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Sat, 3 May 2014 14:55:04 -0700 Subject: [PATCH] Improve in-line documentation of $wgUrlProtocols; add 'redis://' * 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 | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 8c96727a8f..0ca35f0203 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 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:', '//' ); /** -- 2.20.1