* Added new serendipity['defaultBaseURL'] variable that makes sure

that the baseURL is not overriden when configuring serendipity
      with a possibly autodetected currentl URL. Patch by Manko10.
This commit is contained in:
Garvin Hicking 2011-09-28 12:03:28 +00:00
parent 56041459b6
commit c292badf30
5 changed files with 14 additions and 3 deletions

@ -4,6 +4,10 @@
Version 1.7 ()
------------------------------------------------------------------------
* Added new serendipity['defaultBaseURL'] variable that makes sure
that the baseURL is not overriden when configuring serendipity
with a possibly autodetected currentl URL. Patch by Manko10.
Version 1.6 ()
------------------------------------------------------------------------

@ -30,14 +30,14 @@ switch ($_POST['installAction'] && serendipity_checkFormToken()) {
$permalinkOld = array(
$oldConfig['serendipityHTTPPath'],
$oldConfig['serendipityPath'],
$oldConfig['baseURL'],
$oldConfig['defaultBaseURL'],
$oldConfig['indexFile'],
$oldConfig['rewrite']);
$permalinkNew = array(
$serendipity['serendipityHTTPPath'],
$serendipity['serendipityPath'],
$serendipity['baseURL'],
$serendipity['defaultBaseURL'],
$serendipity['indexFile'],
$serendipity['rewrite']);

@ -329,6 +329,12 @@ function serendipity_load_configuration($author = null) {
}
$config_loaded[$author] = true;
// Set baseURL to defaultBaseURL
if ((empty($author) || empty($serendipity['baseURL'])) && isset($serendipity['defaultBaseURL'])) {
$serendipity['baseURL'] = $serendipity['defaultBaseURL'];
}
// Store default language
$serendipity['default_lang'] = $serendipity['lang'];
}

@ -1000,6 +1000,7 @@ function serendipity_smarty_init($vars = array()) {
'blogDescription' => $serendipity['blogDescription'],
'serendipityHTTPPath' => $serendipity['serendipityHTTPPath'],
'serendipityDefaultBaseURL' => $serendipity['defaultBaseURL'],
'serendipityBaseURL' => $serendipity['baseURL'],
'serendipityRewritePrefix' => $serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '',
'serendipityIndexFile' => $serendipity['indexFile'],

@ -110,7 +110,7 @@
'permission' => 'siteConfiguration',
'default' => 'uploads/'),
array('var' => 'baseURL',
array('var' => 'defaultBaseURL',
'title' => INSTALL_URL,
'description' => INSTALL_URL_DESC,
'type' => 'string',