]> git.mjollnir.org Git - s9y.git/commitdiff
patch by swiesinger: When using shortcut admin URL, use https:// when specified by...
authorgarvinhicking <garvinhicking>
Fri, 27 May 2005 08:16:07 +0000 (08:16 +0000)
committergarvinhicking <garvinhicking>
Fri, 27 May 2005 08:16:07 +0000 (08:16 +0000)
docs/NEWS
index.php

index 5ae76982b4b2bebe6d3b267301865216c4c596a2..9793349141ffc6a13acbcecfeadd01e91fc1a293 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 0.9 ()
 ------------------------------------------------------------------------
 
+    * Patch/Bug #1209410 by swiesinger: When using shortcut admin URL,
+      use https:// when specified by user
+
     * Added swedish translation by Torbjörn Hedberg, Added european 
       portugues translation by Joao Palhoto Matos, Added hungarian
       translation by Posz Marton
index c2f1502a2dcf12a61361e9f48decfe4410088df0..afd4a47d3ee9b7622c3cf649136fa6bff74433c4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -233,7 +233,11 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
     print $data;
     exit;
 } else if (preg_match(PAT_ADMIN, $uri)) {
-    header("Location: {$serendipity['baseURL']}serendipity_admin.php");
+    $base = $serendipity['baseURL'];
+    if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
+        $base = str_replace('http://', 'https://', $base);
+    }
+    header("Location: {$base}serendipity_admin.php");
     exit;
 } else if (preg_match(PAT_ARCHIVE, $uri)) {
     $serendipity['GET']['action'] = 'archives';