OSDN Git Service

BugTrack/554 HTTP 'Location:' header needs absolute URI
authorhenoheno <henoheno>
Sun, 10 Oct 2004 10:20:59 +0000 (19:20 +0900)
committerhenoheno <henoheno>
Sun, 10 Oct 2004 10:20:59 +0000 (19:20 +0900)
lib/func.php
plugin/amazon.inc.php
plugin/bugtrack.inc.php
plugin/edit.inc.php
plugin/newpage.inc.php
plugin/pcomment.inc.php
plugin/rename.inc.php
plugin/tracker.inc.php

index 28fbb5e..1d826c7 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: func.php,v 1.7 2004/10/10 02:22:19 henoheno Exp $
+// $Id: func.php,v 1.8 2004/10/10 10:20:59 henoheno Exp $
 //
 
 // Ê¸»úÎó¤¬InterWikiName¤«¤É¤¦¤«
@@ -518,6 +518,10 @@ function get_autolink_pattern_sub(& $pages, $start, $end, $pos)
 // pukiwiki.php¥¹¥¯¥ê¥×¥È¤Îabsolute-uri¤òÀ¸À®
 function get_script_uri()
 {
+       static $script;
+
+       if (isset($script)) return $script;
+
        $script  = (SERVER_PORT == 443 ? 'https://' : 'http://');       // scheme
        $script .= SERVER_NAME; // host
        $script .= (SERVER_PORT == 80 ? '' : ':' . SERVER_PORT); // port
index cb774dc..0ef1c60 100644 (file)
@@ -44,7 +44,7 @@
 //
 
 /////////////////////////////////////////////////
-// $Id: amazon.inc.php,v 1.2 2004/07/31 03:09:19 henoheno Exp $
+// $Id: amazon.inc.php,v 1.3 2004/10/10 10:20:59 henoheno Exp $
 // - modified by arino <arino@users.sourceforge.jp>
 // -- replace plugin_amazon_get_page().
 // -- AMAZON_XML 'xml.amazon.com' -> 'xml.amazon.co.jp'
@@ -182,15 +182,15 @@ function plugin_amazon_action() {
 
   if ($edit_auth and (!isset($_SERVER['PHP_AUTH_USER']) or !array_key_exists($_SERVER['PHP_AUTH_USER'],$edit_auth_users) or
       $edit_auth_users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW'])) {
-    header("Location: $script?cmd=read&page=$r_page_url");
+    header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page_url);
   } else {
     $title = plugin_amazon_get_asin_title();
     if ($title == '' or preg_match('/^\//', $s_page)) {
-      header("Location: $script?cmd=read&page=" . encode($s_page));
+      header('Location: ' . get_script_uri() . '?cmd=read&page=' . encode($s_page));
     }
     $body = "#amazon($asin_all,,image)\n*$title\n" . $amazon_body;
     plugin_amazon_review_save($r_page, $body);
-    header("Location: $script?cmd=edit&page=$r_page_url");
+    header('Location: ' . get_script_uri() . '?cmd=edit&page=' . $r_page_url);
   }
   die();
 }
index 54f7700..47990e1 100644 (file)
@@ -8,7 +8,7 @@
  * Êѹ¹ÍúÎò:
  *  2002.06.17: ºî¤ê»Ï¤á
  *
- * $Id: bugtrack.inc.php,v 1.16 2004/07/31 03:09:20 henoheno Exp $
+ * $Id: bugtrack.inc.php,v 1.17 2004/10/10 10:20:59 henoheno Exp $
  */
 
 function plugin_bugtrack_init()
@@ -39,11 +39,11 @@ function plugin_bugtrack_init()
 
 function plugin_bugtrack_action()
 {
-       global $script,$post,$vars,$_bugtrack_plugin_title;
+       global $post, $vars, $_bugtrack_plugin_title;
 
        if ($post['mode'] == 'submit') {
                $page = plugin_bugtrack_write($post['base'], $post['pagename'], $post['summary'], $post['name'], $post['priority'], $post['state'], $post['category'], $post['version'], $post['body']);
-               header("Location: $script?".rawurlencode($page));
+               header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
                die;
        }
        return FALSE;
index b310e54..aded3bb 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: edit.inc.php,v 1.17 2004/10/09 08:25:29 henoheno Exp $
+// $Id: edit.inc.php,v 1.18 2004/10/10 10:20:59 henoheno Exp $
 //
 
 // ÊÔ½¸
@@ -77,7 +77,7 @@ function plugin_edit_preview()
 // ½ñ¤­¹þ¤ß¤â¤·¤¯¤ÏÄɲä⤷¤¯¤Ï¥³¥á¥ó¥È¤ÎÁÞÆþ
 function plugin_edit_write()
 {
-       global $script, $vars;
+       global $vars;
        global $_title_collided, $_msg_collided_auto, $_msg_collided, $_title_deleted;
 
        $page = isset($vars['page']) ? $vars['page'] : '';
@@ -118,7 +118,7 @@ function plugin_edit_write()
                page_write($page, $postdata, $notimestamp);
 
                if ($postdata) {
-                       header("Location: $script?" . rawurlencode($page));
+                       header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
                        exit;
                }
 
index 55066d3..737b54d 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-// $Id: newpage.inc.php,v 1.9 2004/07/31 03:09:20 henoheno Exp $
+// $Id: newpage.inc.php,v 1.10 2004/10/10 10:20:59 henoheno Exp $
 
 function plugin_newpage_convert()
 {
@@ -31,7 +31,7 @@ EOD;
 
 function plugin_newpage_action()
 {
-       global $vars,$script,$_btn_edit,$_msg_newpage;
+       global $vars, $_btn_edit, $_msg_newpage;
 
        if ($vars['page'] == '') {
                $retvars['msg'] = $_msg_newpage;
@@ -43,7 +43,7 @@ function plugin_newpage_action()
                get_fullname($page,$vars['refer']) : $page);
        $r_refer = rawurlencode($vars['refer']);
 
-       header("Location: $script?cmd=read&page=$r_page&refer=$r_refer");
+       header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page . '&refer=' . $r_refer);
        die();
 }
 ?>
index 406fead..d899ff2 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: pcomment.inc.php,v 1.33 2004/10/09 08:01:58 henoheno Exp $
+// $Id: pcomment.inc.php,v 1.34 2004/10/10 10:20:59 henoheno Exp $
 //
 
 /*
@@ -60,7 +60,7 @@ define('PCMT_TIMESTAMP', 0);
 
 function plugin_pcomment_action()
 {
-       global $script, $vars;
+       global $vars;
 
        if (! isset($vars['msg']) || $vars['msg'] == '') return array();
        $refer = isset($vars['refer']) ? $vars['refer'] : '';
@@ -71,7 +71,7 @@ function plugin_pcomment_action()
                return $retval;
        }
 
-       header("Location: $script?" . rawurlencode($refer));
+       header('Location: ' . get_script_uri() . '?' . rawurlencode($refer));
        exit;
 }
 
index 86d7896..b4e41f4 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: rename.inc.php,v 1.15 2004/07/31 03:09:20 henoheno Exp $
+// $Id: rename.inc.php,v 1.16 2004/10/10 10:20:59 henoheno Exp $
 //
 
 /*
@@ -399,7 +399,7 @@ function rename_get_files($pages)
 
 function rename_proceed($pages, $files, $exists)
 {
-       global $script, $now, $_rename_messages;
+       global $now, $_rename_messages;
 
        if (rename_getvar('exist') == '')
        {
@@ -472,7 +472,7 @@ function rename_proceed($pages, $files, $exists)
        {
                $page = RENAME_LOGPAGE;
        }
-       header("Location: $script?" . rawurlencode($page));
+       header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
        die();
 }
 
index 507db39..9a237fb 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: tracker.inc.php,v 1.23 2004/10/09 08:25:29 henoheno Exp $
+// $Id: tracker.inc.php,v 1.24 2004/10/10 10:20:59 henoheno Exp $
 //
 
 // tracker_list¤Çɽ¼¨¤·¤Ê¤¤¥Ú¡¼¥¸Ì¾(Àµµ¬É½¸½¤Ç)
@@ -79,7 +79,7 @@ EOD;
 }
 function plugin_tracker_action()
 {
-       global $script,$post,$vars,$now;
+       global $post, $vars, $now;
 
        $config_name = array_key_exists('_config',$post) ? $post['_config'] : '';
 
@@ -171,7 +171,7 @@ function plugin_tracker_action()
 
        $r_page = rawurlencode($page);
 
-       header("Location: $script?$r_page");
+       header('Location: ' . get_script_uri() . '?' . $r_page);
        exit;
 }
 /*