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
This commit is contained in:
Timo Tijhof 2017-11-27 20:46:38 -08:00 committed by Krinkle
parent 8d6a9af090
commit 0d5f8f6bee

View file

@ -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