From: Tim Starling Date: Tue, 28 Feb 2006 12:33:40 +0000 (+0000) Subject: Maintain backwards-compatibility in $wgUrlProtocols, so that wikis don't get transfor... X-Git-Tag: 1.6.0~254 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=e1ff7bf5881d5e12b0a4435a6c480920876bb718;p=lhc%2Fweb%2Fwiklou.git Maintain backwards-compatibility in $wgUrlProtocols, so that wikis don't get transformed into a sea of external links when upgrading from 1.5 to 1.6: http://jan.moesen.nu/media/images/screenshots/2006/20060228-mediawiki-1.6a-fubar.png --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index f5e6486ac2..0850cb9b03 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1713,11 +1713,17 @@ function in_string( $needle, $str ) { function wfUrlProtocols() { global $wgUrlProtocols; - $protocols = array(); - foreach ($wgUrlProtocols as $protocol) - $protocols[] = preg_quote( $protocol, '/' ); - - return implode( '|', $protocols ); + // Support old-style $wgUrlProtocols strings, for backwards compatibility + // with LocalSettings files from 1.5 + if ( is_array( $wgUrlProtocols ) ) { + $protocols = array(); + foreach ($wgUrlProtocols as $protocol) + $protocols[] = preg_quote( $protocol, '/' ); + + return implode( '|', $protocols ); + } else { + return $wgUrlProtocols; + } } /**