vanillaforums/Garden — Issue #1261: _ParseRequest() ignoring predefined WebRoot
Author: zamrih
Created: 2011-12-06 10:24:28+00:00
State: open

Hi,

In an attempt to integrate vanilla forums into another web app ( calling the bootsrap and inject a request object in the dispatcher ), it turns out that whether the WebRoot is configured from the config.php file or forced upon the global request object, there's systematically an attempt to resolve it from the PHP_SELF server array when the _ParseRequest() method gets called.

That resolve process should be done as a last resort I guess.

One first attempt to get the WebRoot value shoud be any already parsed request value, then if none the global config parameter should be checked and then finally try to resolve the WebRoot from the PHP_SELF server array.

"library/core/class.request.php" :

...
protected function _ParseRequest() {
...
/**
* Resolve WebRoot
*/

// Attempt to get the webroot from the server
$WebRoot = FALSE;
...

//////////////////////////////////////////////////////////////////////////////////

"library/core/class.request.php" :

...
protected function _ParseRequest() {
...
/**
* Resolve WebRoot
*/

$WebRoot = FALSE;

$WebRootFromConfig = $this->_EnvironmentElement('ConfigWebRoot');

if ($WebRootFromConfig)
$WebRoot = $WebRootFromConfig;
else
$WebRoot = FALSE;

if (!$WebRoot) {
$WebRootFromParsedRequest = $this->_ParsedRequestElement('WebRoot');

if ($WebRootFromParsedRequest)
$WebRoot = $WebRootFromParsedRequest;
else
$WebRoot = FALSE;
}

// Attempt to get the webroot from the server
...