mirror of
https://github.com/processwire/processwire.git
synced 2025-08-21 22:06:12 +02:00
Update for additional suggestions in processwire/processwire-issues#518
This commit is contained in:
@@ -743,16 +743,20 @@ class ProcessWire extends Wire {
|
||||
* @param array $options Options to modify default behaviors (experimental):
|
||||
* - `siteDir` (string): Name of "site" directory in $rootPath that contains site's config.php, no slashes (default="site").
|
||||
* @return Config
|
||||
* @throws WireException
|
||||
*
|
||||
*/
|
||||
public static function buildConfig($rootPath, $rootURL = null, array $options = array()) {
|
||||
|
||||
if(strpos($rootPath, '..') !== false) {
|
||||
$rootPath = realpath($rootPath);
|
||||
if($rootPath === false) throw new WireException("Path not found");
|
||||
}
|
||||
|
||||
if(DIRECTORY_SEPARATOR != '/') {
|
||||
$rootPath = str_replace(DIRECTORY_SEPARATOR, '/', $rootPath);
|
||||
}
|
||||
|
||||
if(strpos($rootPath, '..') !== false) $rootPath = realpath($rootPath);
|
||||
|
||||
$httpHost = '';
|
||||
$scheme = '';
|
||||
$siteDir = isset($options['siteDir']) ? $options['siteDir'] : 'site';
|
||||
|
Reference in New Issue
Block a user