* 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

View File

@ -4,6 +4,10 @@
Version 1.7 () 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 () Version 1.6 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------

View File

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

View File

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

View File

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

View File

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