diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2017-11-27 20:46:38 -0800 |
---|---|---|
committer | Krinkle <krinklemail@gmail.com> | 2017-11-29 21:51:44 +0000 |
commit | 0d5f8f6bee296c4e29f03acbd5c07f34d6c8a88a (patch) | |
tree | 2844ef8dd54dfa2b38c6e1b22975e5aa4afbf641 /includes/WebStart.php | |
parent | 8d6a9af090b09a1321b6d84389a9beac4fc139a7 (diff) | |
download | mediawikicore-0d5f8f6bee296c4e29f03acbd5c07f34d6c8a88a.tar.gz mediawikicore-0d5f8f6bee296c4e29f03acbd5c07f34d6c8a88a.zip |
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.
```
<?php
require __DIR__ . '/mediawiki/index.php';
```
Failure:
> 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
Diffstat (limited to 'includes/WebStart.php')
-rw-r--r-- | includes/WebStart.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/includes/WebStart.php b/includes/WebStart.php index e4d93f9a30d2..be95779af31a 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 |