From e1ff7bf5881d5e12b0a4435a6c480920876bb718 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 28 Feb 2006 12:33:40 +0000 Subject: [PATCH] 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 --- includes/GlobalFunctions.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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; + } } /** -- 2.20.1