1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 10:15:28 +02:00

Add the “Regular” site profile to the core as another installation profile option

This commit is contained in:
Ryan Cramer
2018-06-01 13:26:07 -04:00
parent ecf812224f
commit f6d8d3510f
35 changed files with 2938 additions and 10 deletions

View File

@@ -131,12 +131,16 @@ class Paths extends WireData {
$value = $http . $this->_root;
} else {
$value = parent::get($key);
if(!is_null($value) && strlen($value)) {
if($value[0] == '/' || (DIRECTORY_SEPARATOR != '/' && $value[1] == ':')) {
$value = $http . $value;
} else {
$value = $http . $this->_root . $value;
}
if($value === null || !strlen($value)) return $value;
$pos = strpos($value, '//');
if($pos !== false && ($pos === 0 || ($pos > 0 && $value[$pos-1] === ':'))) {
// fully qualified URL
} else if($value[0] == '/' || (DIRECTORY_SEPARATOR != '/' && $value[1] == ':')) {
// path specifies its own root
$value = $http . $value;
} else {
// path needs root prepended
$value = $http . $this->_root . $value;
}
}
return $value;