From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/api/ApiFormatBase.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes/api/ApiFormatBase.php') diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 8f08f4db..9efbbbe0 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -199,15 +199,17 @@ See complete documentation, or * This method also replaces any '<' with < */ 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('/\<(!--.*?--|.*?)\>/', '<\1>', $text); // identify URLs - $protos = "http|https|ftp|gopher"; + $protos = implode("|", $wgUrlProtocols); # This regex hacks around bug 13218 (" included in the URL) - $text = preg_replace("#(($protos)://.*?)(")?([ \\'\"()<\n])#", '\\1\\3\\4', $text); + $text = preg_replace("#(($protos).*?)(")?([ \\'\"()<\n])#", '\\1\\3\\4', $text); // identify requests to api.php $text = preg_replace("#api\\.php\\?[^ \\()<\n\t]+#", '\\0', $text); if( $this->mHelp ) { @@ -239,7 +241,7 @@ See complete documentation, or } public static function getBaseVersion() { - return __CLASS__ . ': $Id: ApiFormatBase.php 44569 2008-12-14 08:31:04Z tstarling $'; + return __CLASS__ . ': $Id: ApiFormatBase.php 43470 2008-11-14 00:30:34Z tstarling $'; } } @@ -300,6 +302,6 @@ class ApiFormatFeedWrapper extends ApiFormatBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiFormatBase.php 44569 2008-12-14 08:31:04Z tstarling $'; + return __CLASS__ . ': $Id: ApiFormatBase.php 43470 2008-11-14 00:30:34Z tstarling $'; } } -- cgit v1.2.3-54-g00ecf