mirror of
https://github.com/processwire/processwire.git
synced 2025-08-22 06:13:57 +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):
|
* @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").
|
* - `siteDir` (string): Name of "site" directory in $rootPath that contains site's config.php, no slashes (default="site").
|
||||||
* @return Config
|
* @return Config
|
||||||
|
* @throws WireException
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function buildConfig($rootPath, $rootURL = null, array $options = array()) {
|
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 != '/') {
|
if(DIRECTORY_SEPARATOR != '/') {
|
||||||
$rootPath = str_replace(DIRECTORY_SEPARATOR, '/', $rootPath);
|
$rootPath = str_replace(DIRECTORY_SEPARATOR, '/', $rootPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($rootPath, '..') !== false) $rootPath = realpath($rootPath);
|
|
||||||
|
|
||||||
$httpHost = '';
|
$httpHost = '';
|
||||||
$scheme = '';
|
$scheme = '';
|
||||||
$siteDir = isset($options['siteDir']) ? $options['siteDir'] : 'site';
|
$siteDir = isset($options['siteDir']) ? $options['siteDir'] : 'site';
|
||||||
|
Reference in New Issue
Block a user