Admin: Improve completion of first URL when enabling multiple URLs - refs GH#3516

pull/4334/head
Yannick Warnier 3 years ago
parent 28c8283e27
commit 0287acb312
  1. 7
      public/main/admin/access_url_edit.php

@ -41,6 +41,13 @@ if (isset($_GET['url_id'])) {
}
$url_data = UrlManager::get_url_data_from_id($url_id);
$form->addElement('hidden', 'id', $url_data['id']);
// If we're still with localhost (should only happen at the very beginning)
// offer the current URL by default. Once this has been saved, no more
// magic will happen, ever.
if ($url_data['id'] === 1 && $url_data['url'] === 'http://localhost/') {
$https = api_is_https() ? 'https://' : 'http://';
$url_data['url'] = $https.$_SERVER['HTTP_HOST'].'/';
}
$form->setDefaults($url_data);
$submit_name = get_lang('Add URL');
}

Loading…
Cancel
Save