From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/api/ApiFormatBase.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'includes/api/ApiFormatBase.php') diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 9d1dfbc1..ce881599 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -1,6 +1,6 @@ getMain()->getRequest()->response()->header( "Content-Type: $mime; charset=utf-8" ); if ( $isHtml ) { ?> - + mUnescapeAmps ) { @@ -169,7 +169,7 @@ abstract class ApiFormatBase extends ApiBase { You are looking at the HTML representation of the mFormat ); ?> format.
HTML is good for debugging, but probably is not suitable for your application.
-See complete documentation, or +See complete documentation, or API help for more information.
complete documentation, or * @return string */ 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 = implode( "|", $wgUrlProtocols ); + $protos = wfUrlProtocolsWithoutProtRel(); // This regex hacks around bug 13218 (" included in the URL) $text = preg_replace( "#(($protos).*?)(")?([ \\'\"<>\n]|<|>|")#", '\\1\\3\\4', $text ); // identify requests to api.php @@ -294,12 +292,16 @@ See complete documentation, or return 'api.php?action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName(); } + public function getHelpUrls() { + return 'https://www.mediawiki.org/wiki/API:Data_formats'; + } + public function getDescription() { return $this->getIsHtml() ? ' (pretty-print in HTML)' : ''; } public static function getBaseVersion() { - return __CLASS__ . ': $Id: ApiFormatBase.php 75970 2010-11-04 00:55:30Z reedy $'; + return __CLASS__ . ': $Id: ApiFormatBase.php 104449 2011-11-28 15:52:04Z reedy $'; } } @@ -368,6 +370,6 @@ class ApiFormatFeedWrapper extends ApiFormatBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiFormatBase.php 75970 2010-11-04 00:55:30Z reedy $'; + return __CLASS__ . ': $Id: ApiFormatBase.php 104449 2011-11-28 15:52:04Z reedy $'; } -} \ No newline at end of file +} -- cgit v1.2.3-54-g00ecf