From b6c19d49965caece085e7ee0da9c619b14f19655 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 24 Jan 2007 09:26:41 +0000 Subject: Aktualisierung auf MediaWiki 1.9.1 --- includes/DefaultSettings.php | 6 +++--- includes/DjVuImage.php | 3 ++- includes/Exception.php | 3 ++- includes/GlobalFunctions.php | 2 +- includes/Image.php | 2 +- includes/Skin.php | 7 ------- includes/WebRequest.php | 15 ++++++++++++++- includes/Wiki.php | 5 ++--- includes/api/ApiFormatBase.php | 6 +++--- includes/api/ApiQueryRevisions.php | 4 ++-- 10 files changed, 30 insertions(+), 23 deletions(-) (limited to 'includes') diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 03697b69..3790be87 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -32,7 +32,7 @@ require_once( 'includes/SiteConfiguration.php' ); $wgConf = new SiteConfiguration; /** MediaWiki version number */ -$wgVersion = '1.9.0'; +$wgVersion = '1.9.1'; /** Name of the site. It must be changed in LocalSettings.php */ $wgSitename = 'MediaWiki'; @@ -1096,7 +1096,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '42'; +$wgStyleVersion = '42a'; # Server-side caching: @@ -2237,7 +2237,7 @@ $wgTrustedMediaFormats= array( MEDIATYPE_VIDEO, //all plain video formats "image/svg", //svg (only needed if inline rendering of svg is not supported) "application/pdf", //PDF files - #"application/x-shockwafe-flash", //flash/shockwave movie + #"application/x-shockwave-flash", //flash/shockwave movie ); /** diff --git a/includes/DjVuImage.php b/includes/DjVuImage.php index f7297dc2..3b8a68ba 100644 --- a/includes/DjVuImage.php +++ b/includes/DjVuImage.php @@ -216,7 +216,8 @@ class DjVuImage { function retrieveMetaData() { global $wgDjvuToXML; if ( isset( $wgDjvuToXML ) ) { - $cmd = $wgDjvuToXML . ' --without-anno --without-text ' . $this->mFilename; + $cmd = $wgDjvuToXML . ' --without-anno --without-text ' . + wfEscapeShellArg( $this->mFilename ); $xml = wfShellExec( $cmd ); } else { $xml = null; diff --git a/includes/Exception.php b/includes/Exception.php index ac9c8a21..ad7ec14a 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -54,10 +54,11 @@ class MWException extends Exception } function getLogMessage() { + global $wgRequest; $file = $this->getFile(); $line = $this->getLine(); $message = $this->getMessage(); - return "{$_SERVER['REQUEST_URI']} Exception from line $line of $file: $message"; + return $wgRequest->getRequestURL() . " Exception from line $line of $file: $message"; } function reportHTML() { diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 08094ca1..da24e4a7 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -230,7 +230,7 @@ function wfLogProfilingData() { $forward .= ' anon'; $log = sprintf( "%s\t%04.3f\t%s\n", gmdate( 'YmdHis' ), $elapsed, - urldecode( $_SERVER['REQUEST_URI'] . $forward ) ); + urldecode( $wgRequest->getRequestURL() . $forward ) ); if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) { error_log( $log . $prof, 3, $wgDebugLogFile ); } diff --git a/includes/Image.php b/includes/Image.php index 1f3895c6..7a6442c3 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -2271,7 +2271,7 @@ class Image # Check for files uploaded prior to DJVU support activation # They have a '0' in their metadata field. # - if ( $this->metadata == '0' ) { + if ( $this->metadata == '0' || $this->metadata == '' ) { $deja = new DjVuImage( $this->imagePath ); $this->metadata = $deja->retrieveMetaData(); $this->purgeMetadataCache(); diff --git a/includes/Skin.php b/includes/Skin.php index 3e4f5d3c..f8e733ef 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -783,13 +783,6 @@ END; function printableLink() { global $wgOut, $wgFeedClasses, $wgRequest; - $baseurl = $_SERVER['REQUEST_URI']; - if( strpos( '?', $baseurl ) == false ) { - $baseurl .= '?'; - } else { - $baseurl .= '&'; - } - $baseurl = htmlspecialchars( $baseurl ); $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' ); $s = "" . wfMsg( 'printableversion' ) . ''; diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 35336954..7648b75f 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -314,7 +314,20 @@ class WebRequest { * @return string */ function getRequestURL() { - $base = $_SERVER['REQUEST_URI']; + if( isset( $_SERVER['REQUEST_URI'] ) ) { + $base = $_SERVER['REQUEST_URI']; + } elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) { + // Probably IIS; doesn't set REQUEST_URI + $base = $_SERVER['SCRIPT_NAME']; + if( isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ) { + $base .= '?' . $_SERVER['QUERY_STRING']; + } + } else { + // This shouldn't happen! + throw new MWException( "Web server doesn't provide either " . + "REQUEST_URI or SCRIPT_NAME. Report details of your " . + "web server configuration to http://bugzilla.wikimedia.org/" ); + } if( $base{0} == '/' ) { return $base; } else { diff --git a/includes/Wiki.php b/includes/Wiki.php index 4fa421a6..06ae8cfe 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -118,7 +118,7 @@ class MediaWiki { * Initialize the object to be known as $wgArticle for special cases */ function initializeSpecialCases ( &$title, &$output, $request ) { - + global $wgRequest; wfProfileIn( 'MediaWiki::initializeSpecialCases' ); $search = $this->getVal('Search'); @@ -151,8 +151,7 @@ class MediaWiki { $targetUrl = $title->getFullURL(); // Redirect to canonical url, make it a 301 to allow caching global $wgServer, $wgUsePathInfo; - if( isset( $_SERVER['REQUEST_URI'] ) && - $targetUrl == $wgServer . $_SERVER['REQUEST_URI'] ) { + if( $targetUrl == $wgRequest->getFullRequestURL() ) { $message = "Redirect loop detected!\n\n" . "This means the wiki got confused about what page was " . "requested; this sometimes happens when moving a wiki " . diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 611960d3..338a6c07 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -81,7 +81,7 @@ abstract class ApiFormatBase extends ApiBase { if (is_null($mime)) return; // skip any initialization - header("Content-Type: $mime; charset=utf-8;"); + header("Content-Type: $mime; charset=utf-8"); if ($isHtml) { ?> @@ -170,7 +170,7 @@ for more information. } public static function getBaseVersion() { - return __CLASS__ . ': $Id: ApiFormatBase.php 17374 2006-11-03 06:53:47Z yurik $'; + return __CLASS__ . ': $Id: ApiFormatBase.php 19434 2007-01-18 02:04:11Z brion $'; } } @@ -226,7 +226,7 @@ class ApiFormatFeedWrapper extends ApiFormatBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiFormatBase.php 17374 2006-11-03 06:53:47Z yurik $'; + return __CLASS__ . ': $Id: ApiFormatBase.php 19434 2007-01-18 02:04:11Z brion $'; } } ?> diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 3f678ff7..e92b92c9 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -177,7 +177,7 @@ class ApiQueryRevisions extends ApiQueryBase { // Ensure that all revisions are shown as '' elements $result = $this->getResult(); if ($result->getIsRawMode()) { - $data = $result->getData(); + $data =& $result->getData(); foreach ($data['query']['pages'] as & $page) { if (is_array($page) && array_key_exists('revisions', $page)) { $result->setIndexedTagName($page['revisions'], 'rev'); @@ -262,7 +262,7 @@ class ApiQueryRevisions extends ApiQueryBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryRevisions.php 17374 2006-11-03 06:53:47Z yurik $'; + return __CLASS__ . ': $Id: ApiQueryRevisions.php 19434 2007-01-18 02:04:11Z brion $'; } } ?> -- cgit v1.2.3-54-g00ecf