From 0d5f8f6bee296c4e29f03acbd5c07f34d6c8a88a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 27 Nov 2017 20:46:38 -0800 Subject: [PATCH] WebStart: Remove use of realpath() for $IP When installing MediaWiki in a sub directory of document root, and including it from an /index.php file in the document root, MediaWiki succesfully includes WebStart from index.php, but WebStart.php fails to include Setup.php. For example, MediaWiki installation at /var/www/mediawiki with the following file at /var/www/index.php. ``` Fatal error: > require_once(): Failed opening required '/var/www/includes/Setup.php' > (include_path='.:/usr/local/lib/php') in > /var/www/mediawiki/includes/WebStart.php on line 97 > > Stack trace: > 1. {main}() /var/www/index.php:0 > 2. require() /var/www/index.php:3 > 3. require() /var/www/mediawiki/index.php:40 Bug: T153882 Change-Id: Icd8cfa580ce1c22bc3bf177570a9f4a940d2427c --- includes/WebStart.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/WebStart.php b/includes/WebStart.php index e4d93f9a30..be95779af3 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -50,13 +50,10 @@ unset( $IP ); # its purpose. define( 'MEDIAWIKI', true ); -# Full path to working directory. -# Makes it possible to for example to have effective exclude path in apc. -# __DIR__ breaks symlinked includes, but realpath() returns false -# if we don't have permissions on parent directories. +# Full path to the installation directory. $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { - $IP = realpath( '.' ) ?: dirname( __DIR__ ); + $IP = dirname( __DIR__ ); } // If no LocalSettings file exists, try to display an error page -- 2.20.1