• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂2019096e9db9b2b3fa210b5570da0b12c48f764e (tree)
時間2017-09-03 21:22:17
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2213 Use get_base_uri() instead of get_script_uri()

Change Summary

差異

--- a/lib/auth.php
+++ b/lib/auth.php
@@ -307,8 +307,8 @@ function basic_auth($page, $auth_enabled, $exit_on_fail, $auth_pages, $title_can
307307 header('WWW-Authenticate: Basic realm="' . $_msg_auth . '"');
308308 header('HTTP/1.0 401 Unauthorized');
309309 } elseif (AUTH_TYPE_FORM === $auth_type) {
310- $url_after_login = get_script_uri() . '?' . $g_query_string;
311- $loginurl = get_script_uri() . '?plugin=loginform'
310+ $url_after_login = get_base_uri() . '?' . $g_query_string;
311+ $loginurl = get_base_uri() . '?plugin=loginform'
312312 . '&page=' . rawurlencode($page)
313313 . '&url_after_login=' . rawurlencode($url_after_login);
314314 header('HTTP/1.0 302 Found');
--- a/lib/init.php
+++ b/lib/init.php
@@ -143,7 +143,7 @@ if (isset($script)) {
143143
144144 // INI_FILE: Auth settings
145145 if (isset($auth_type) && $auth_type === AUTH_TYPE_SAML) {
146- $auth_external_login_url_base = get_script_uri() . '?//cmd.saml//sso';
146+ $auth_external_login_url_base = get_base_uri() . '?//cmd.saml//sso';
147147 }
148148
149149
--- a/lib/make_link.php
+++ b/lib/make_link.php
@@ -322,7 +322,7 @@ EOD;
322322 if (PKWK_ALLOW_RELATIVE_FOOTNOTE_ANCHOR) {
323323 $script = '';
324324 } else {
325- $script = get_script_uri() . '?' . pagename_urlencode($page);
325+ $script = get_page_uri($page);
326326 }
327327
328328 $id = ++$note_id;
--- a/lib/plugin.php
+++ b/lib/plugin.php
@@ -30,9 +30,9 @@ function exist_plugin($name)
3030 die('Alert: plugin "' . htmlsc($name) .
3131 '" was called over ' . PKWK_PLUGIN_CALL_TIME_LIMIT .
3232 ' times. SPAM or someting?<br />' . "\n" .
33- '<a href="' . get_script_uri() . '?cmd=edit&amp;page='.
33+ '<a href="' . get_base_uri() . '?cmd=edit&amp;page='.
3434 rawurlencode($vars['page']) . '">Try to edit this page</a><br />' . "\n" .
35- '<a href="' . get_script_uri() . '">Return to frontpage</a>');
35+ '<a href="' . get_base_uri() . '">Return to frontpage</a>');
3636 return $exist[$name];
3737 }
3838
--- a/plugin/aname.inc.php
+++ b/plugin/aname.inc.php
@@ -102,7 +102,7 @@ function plugin_aname_tag($args = array(), $convert = TRUE)
102102 $id = htmlsc($id); // Insurance
103103 $class = $f_super ? 'anchor_super' : 'anchor';
104104 $attr_id = $f_noid ? '' : ' id="' . $id . '"';
105- $url = $f_full ? get_script_uri() . '?' . pagename_urlencode($vars['page']) : '';
105+ $url = $f_full ? get_page_uri($vars['page']) : '';
106106 if ($body != '') {
107107 $href = ' href="' . $url . '#' . $id . '"';
108108 $title = ' title="' . $id . '"';
--- a/plugin/backup.inc.php
+++ b/plugin/backup.inc.php
@@ -1,8 +1,8 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // backup.inc.php
4-// Copyright (C)
5-// 2002-2016 PukiWiki Development Team
4+// Copyright
5+// 2002-2017 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -40,7 +40,7 @@ function plugin_backup_action()
4040 $s_age = (isset($vars['age']) && is_numeric($vars['age'])) ? $vars['age'] : 0;
4141 if ($s_age <= 0) return array( 'msg'=>$_title_pagebackuplist, 'body'=>plugin_backup_get_list($page));
4242
43- $script = get_script_uri();
43+ $script = get_base_uri();
4444
4545 $body = '<ul>' . "\n";
4646 $body .= ' <li><a href="' . $script . '?cmd=backup">' . $_msg_backuplist . '</a></li>' ."\n";
@@ -144,7 +144,7 @@ function plugin_backup_delete($page)
144144 }
145145 }
146146
147- $script = get_script_uri();
147+ $script = get_base_uri();
148148 $s_page = htmlsc($page);
149149 $body .= <<<EOD
150150 <p>$_msg_backup_adminpass</p>
@@ -180,7 +180,7 @@ function plugin_backup_get_list($page)
180180 global $_msg_backuplist, $_msg_diff, $_msg_nowdiff, $_msg_source, $_msg_nobackup;
181181 global $_title_backup_delete;
182182
183- $script = get_script_uri();
183+ $script = get_base_uri();
184184 $r_page = rawurlencode($page);
185185 $s_page = htmlsc($page);
186186 $retval = array();
--- a/plugin/basicauthlogout.inc.php
+++ b/plugin/basicauthlogout.inc.php
@@ -1,7 +1,7 @@
11 <?php
2-
32 // PukiWiki - Yet another WikiWikiWeb clone
4-// Copyright (C) 2016 PukiWiki Development Team
3+// basicauthlogout.inc.php
4+// Copyright 2016-2017 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // "Basic auth logout" plugin
@@ -9,7 +9,7 @@
99 function plugin_basicauthlogout_inline()
1010 {
1111 $logout_param = '?plugin=basicauthlogout';
12- return '<a href="' . htmlsc(get_script_uri() . $logout_param) . '">Log out</a>';
12+ return '<a href="' . htmlsc(get_base_uri() . $logout_param) . '">Log out</a>';
1313 }
1414
1515 function plugin_basicauthlogout_convert()
--- a/plugin/bugtrack.inc.php
+++ b/plugin/bugtrack.inc.php
@@ -99,7 +99,7 @@ function plugin_bugtrack_print_form($base, $category)
9999 $encoded_category .= '</select>';
100100 }
101101
102- $script = get_script_uri();
102+ $script = get_base_uri();
103103 $s_base = htmlsc($base);
104104 $s_name = htmlsc($_plugin_bugtrack['name']);
105105 $s_category = htmlsc($_plugin_bugtrack['category']);
--- a/plugin/comment.inc.php
+++ b/plugin/comment.inc.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // comment.inc.php
44 // Copyright
5-// 2002-2016 PukiWiki Development Team
5+// 2002-2017 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -114,7 +114,7 @@ function plugin_comment_convert()
114114 $above = in_array('above', $options) ? '1' :
115115 (in_array('below', $options) ? '0' : PLUGIN_COMMENT_DIRECTION_DEFAULT);
116116
117- $script = get_script_uri();
117+ $script = get_base_uri();
118118 $s_page = htmlsc($vars['page']);
119119 $string = <<<EOD
120120 <br />
--- a/plugin/edit.inc.php
+++ b/plugin/edit.inc.php
@@ -169,7 +169,7 @@ function plugin_edit_inline()
169169 }
170170
171171 // URL
172- $script = get_script_uri();
172+ $script = get_base_uri();
173173 if ($isfreeze) {
174174 $url = $script . '?cmd=unfreeze&amp;page=' . rawurlencode($s_page);
175175 } else {
--- a/plugin/loginform.inc.php
+++ b/plugin/loginform.inc.php
@@ -1,7 +1,6 @@
11 <?php
2-
32 // PukiWiki - Yet another WikiWikiWeb clone
4-// Copyright (C) 2015 PukiWiki Development Team
3+// Copyright 2015-2017 PukiWiki Development Team
54 // License: GPL v2 or (at your option) any later version
65 //
76 // "Login form" plugin
@@ -9,7 +8,7 @@
98 function plugin_loginform_inline()
109 {
1110 $logout_param = '?plugin=basicauthlogout';
12- return '<a href="' . htmlsc(get_script_uri() . $logout_param) . '">Log out</a>';
11+ return '<a href="' . htmlsc(get_base_uri() . $logout_param) . '">Log out</a>';
1312 }
1413
1514 function plugin_loginform_convert()
@@ -27,7 +26,7 @@ function plugin_loginform_action()
2726 if (!$url_after_login) {
2827 $page_after_login = $page;
2928 }
30- $action_url = get_script_uri() . '?plugin=loginform'
29+ $action_url = get_base_uri() . '?plugin=loginform'
3130 . '&page=' . rawurlencode($page)
3231 . ($url_after_login ? '&url_after_login=' . rawurlencode($url_after_login) : '')
3332 . ($page_after_login ? '&page_after_login=' . rawurlencode($page_after_login) : '');
@@ -59,7 +58,7 @@ function plugin_loginform_action()
5958 return array(
6059 'msg' => 'Log out',
6160 'body' => 'Logged out completely<br>'
62- . '<a href="'. get_script_uri() . '?' . pagename_urlencode($page) . '">'
61+ . '<a href="'. get_page_uri($page) . '">'
6362 . $page . '</a>'
6463 );
6564 } else {
--- a/plugin/lookup.inc.php
+++ b/plugin/lookup.inc.php
@@ -1,8 +1,8 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: lookup.inc.php,v 1.23 2011/01/25 15:01:01 henoheno Exp $
4-// Copyright (C)
5-// 2002-2005 PukiWiki Developers Team
3+// lookup.inc.php
4+// Copyright
5+// 2002-2017 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -26,7 +26,7 @@ function plugin_lookup_convert()
2626 $s_page = htmlsc($vars['page']);
2727 ++$id;
2828
29- $script = get_script_uri();
29+ $script = get_base_uri();
3030 $ret = <<<EOD
3131 <form action="$script" method="post">
3232 <div>
@@ -62,4 +62,3 @@ function plugin_lookup_action()
6262 header('Location: ' . $url); // Publish as GET method
6363 exit;
6464 }
65-?>
--- a/plugin/md5.inc.php
+++ b/plugin/md5.inc.php
@@ -1,7 +1,7 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: md5.inc.php,v 1.25 2011/01/25 15:01:01 henoheno Exp $
4-// Copyright (C) 2001-2006 PukiWiki Developers Team
3+// md5.inc.php
4+// Copyright 2001-2017 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // MD5 plugin: Allow to convert password/passphrase
@@ -70,7 +70,7 @@ function plugin_md5_show_form($nophrase = FALSE, $value = '')
7070 $md5_checked = 'checked="checked" ';
7171 }
7272
73- $self = get_script_uri();
73+ $self = get_base_uri();
7474
7575 $form = <<<EOD
7676 <p><strong>NOTICE: Don't use this feature via untrustful or unsure network</strong></p>
@@ -131,4 +131,3 @@ EOD;
131131
132132 return $form;
133133 }
134-?>
--- a/plugin/pcomment.inc.php
+++ b/plugin/pcomment.inc.php
@@ -133,7 +133,7 @@ function plugin_pcomment_convert()
133133 $s_nodate = htmlsc($params['nodate']);
134134 $s_count = htmlsc($count);
135135
136- $form_start = '<form action="' . get_script_uri() . '" method="post">' . "\n";
136+ $form_start = '<form action="' . get_base_uri() . '" method="post">' . "\n";
137137 $form = <<<EOD
138138 <div>
139139 <input type="hidden" name="digest" value="$digest" />
--- a/plugin/recent.inc.php
+++ b/plugin/recent.inc.php
@@ -1,9 +1,10 @@
11 <?php
2-// $Id: recent.inc.php,v 1.27 2011/01/25 15:01:01 henoheno Exp $
3-// Copyright (C)
4-// 2002-2007 PukiWiki Developers Team
2+// PukiWiki - Yet another WikiWikiWeb clone
3+// recent.inc.php
4+// Copyright
5+// 2002-2017 PukiWiki Development Team
56 // 2002 Y.MASUI http://masui.net/pukiwiki/ masui@masui.net
6-// License: GPL version 2
7+// License: GPL v2 or (at your option) any later version
78 //
89 // Recent plugin -- Show RecentChanges list
910 // * Usually used at 'MenuBar' page
@@ -54,8 +55,6 @@ function plugin_recent_convert()
5455 // Get latest N changes
5556 $lines = file_head(PLUGIN_RECENT_CACHE, $recent_lines);
5657 if ($lines == FALSE) return '#recent(): File can not open' . '<br />' . "\n";
57-
58- $script = get_script_uri();
5958 $date = $items = '';
6059 foreach ($lines as $line) {
6160 list($time, $page) = explode("\t", rtrim($line));
@@ -77,9 +76,8 @@ function plugin_recent_convert()
7776 // No need to link to the page you just read, or notify where you just read
7877 $items .= ' <li>' . $s_page . '</li>' . "\n";
7978 } else {
80- $r_page = pagename_urlencode($page);
8179 $passage = $show_passage ? ' ' . get_passage($time) : '';
82- $items .= ' <li><a href="' . $script . '?' . $r_page . '"' .
80+ $items .= ' <li><a href="' . get_page_uri($page) . '"' .
8381 ' title="' . $s_page . $passage . '">' . $s_page . '</a></li>' . "\n";
8482 }
8583 }
@@ -88,4 +86,3 @@ function plugin_recent_convert()
8886
8987 return sprintf($_recent_plugin_frame, count($lines), $items);
9088 }
91-
--- a/plugin/topicpath.inc.php
+++ b/plugin/topicpath.inc.php
@@ -34,7 +34,6 @@ function plugin_topicpath_inline()
3434 {
3535 global $vars, $defaultpage;
3636
37- $script = get_script_uri();
3837 $page = isset($vars['page']) ? $vars['page'] : '';
3938 if ($page == '' || $page == $defaultpage) return '';
4039
@@ -50,7 +49,6 @@ function plugin_topicpath_inline()
5049 $topic_path = array();
5150 while (! empty($parts)) {
5251 $_landing = join('/', $parts);
53- $landing = pagename_urlencode($_landing);
5452 $element = htmlsc(array_pop($parts));
5553 if (! $b_link) {
5654 // This page ($_landing == $page)
@@ -61,7 +59,7 @@ function plugin_topicpath_inline()
6159 $topic_path[] = $element;
6260 } else {
6361 // Page exists or not exists
64- $topic_path[] = '<a href="' . $script . '?' . $landing . '">' .
62+ $topic_path[] = '<a href="' . get_page_uri($_landing) . '">' .
6563 $element . '</a>';
6664 }
6765 }
--- a/plugin/yetlist.inc.php
+++ b/plugin/yetlist.inc.php
@@ -1,7 +1,7 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
3-// $Id: yetlist.inc.php,v 1.29 2011/01/25 15:01:01 henoheno Exp $
4-// Copyright (C) 2001-2006 PukiWiki Developers Team
3+// yetlist.inc.php
4+// Copyright 2001-2017 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // Yet list plugin - Show a list of dangling links (not yet created)
@@ -23,7 +23,7 @@ function plugin_yetlist_action()
2323 $empty = TRUE;
2424
2525 // Load .ref files and Output
26- $script = get_script_uri();
26+ $script = get_base_uri();
2727 $refer_regex = '/' . $non_list . '|^' . preg_quote($whatsdeleted, '/') . '$/S';
2828 asort($pages, SORT_STRING);
2929 foreach ($pages as $file=>$page) {
@@ -43,7 +43,7 @@ function plugin_yetlist_action()
4343 $link_refs = array();
4444 foreach ($refer as $_refer) {
4545 $r_refer = pagename_urlencode($_refer);
46- $link_refs[] = '<a href="' . $script . '?' . $r_refer . '">' .
46+ $link_refs[] = '<a href="' . get_page_uri($_refer) . '">' .
4747 htmlsc($_refer) . '</a>';
4848 }
4949 $link_ref = join(' ', $link_refs);
@@ -73,4 +73,3 @@ function plugin_yetlist_action()
7373
7474 return $retval;
7575 }
76-