From d74aac3510c0cc507f3296fa05233f48583a9470 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 7 Feb 2012 03:43:23 +0000 Subject: [PATCH] * Fix for r81363: instead of giving a PHP notice when PATH_INFO is missing, show the informative error message used before that revision. * Revert the change to the relevant message made in r102612: it is plain text, not wikitext, a format which does not support protocol-relative URLs. --- img_auth.php | 4 ++++ languages/messages/MessagesEn.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/img_auth.php b/img_auth.php index 7f922c5223..f0d100f840 100644 --- a/img_auth.php +++ b/img_auth.php @@ -56,6 +56,10 @@ function wfImageAuthMain() { // Get the requested file path (source file or thumbnail) $matches = WebRequest::getPathInfo(); + if ( !isset( $matches['title'] ) ) { + wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' ); + return; + } $path = $matches['title']; if ( $path && $path[0] !== '/' ) { // Make sure $path has a leading / diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 7bb0317387..dee54335f0 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2295,7 +2295,7 @@ It cannot be properly checked for security.', 'img-auth-nopathinfo' => 'Missing PATH_INFO. Your server is not set up to pass this information. It may be CGI-based and cannot support img_auth. -[//www.mediawiki.org/wiki/Manual:Image_Authorization See image authorization.]', +See http://www.mediawiki.org/wiki/Manual:Image_Authorization.', 'img-auth-notindir' => 'Requested path is not in the configured upload directory.', 'img-auth-badtitle' => 'Unable to construct a valid title from "$1".', 'img-auth-nologinnWL' => 'You are not logged in and "$1" is not in the whitelist.', -- 2.20.1