don't prepend a slash to the domains 'path' value if it's a hostname, fixes #657
This commit is contained in:
@@ -541,10 +541,17 @@ elseif($page == 'domains')
|
||||
|
||||
if(preg_match('/^https?\:\/\//', $result['documentroot'])
|
||||
&& validateUrl($idna_convert->encode($result['documentroot']))
|
||||
&& $settings['panel']['pathedit'] == 'Dropdown')
|
||||
{
|
||||
$urlvalue = $result['documentroot'];
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
) {
|
||||
if($settings['panel']['pathedit'] == 'Dropdown')
|
||||
{
|
||||
$urlvalue = $result['documentroot'];
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$urlvalue = '';
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot'], true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -32,9 +32,10 @@
|
||||
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
|
||||
*/
|
||||
|
||||
function makePathfield($path, $uid, $gid, $fieldType, $value = '')
|
||||
function makePathfield($path, $uid, $gid, $fieldType, $value = '', $dom = false)
|
||||
{
|
||||
global $lng;
|
||||
|
||||
$value = str_replace($path, '', $value);
|
||||
$field = array();
|
||||
|
||||
@@ -42,7 +43,7 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
|
||||
// but dirList holds the paths with starting slash
|
||||
// so we just add one here to get the correct
|
||||
// default path selected, #225
|
||||
if (substr($value, 0, 1) != '/') {
|
||||
if (substr($value, 0, 1) != '/' && !$dom) {
|
||||
$value = '/'.$value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user