修訂 | 2019096e9db9b2b3fa210b5570da0b12c48f764e (tree) |
---|---|
時間 | 2017-09-03 21:22:17 |
作者 | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2213 Use get_base_uri() instead of get_script_uri()
@@ -307,8 +307,8 @@ function basic_auth($page, $auth_enabled, $exit_on_fail, $auth_pages, $title_can | ||
307 | 307 | header('WWW-Authenticate: Basic realm="' . $_msg_auth . '"'); |
308 | 308 | header('HTTP/1.0 401 Unauthorized'); |
309 | 309 | } 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' | |
312 | 312 | . '&page=' . rawurlencode($page) |
313 | 313 | . '&url_after_login=' . rawurlencode($url_after_login); |
314 | 314 | header('HTTP/1.0 302 Found'); |
@@ -143,7 +143,7 @@ if (isset($script)) { | ||
143 | 143 | |
144 | 144 | // INI_FILE: Auth settings |
145 | 145 | 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'; | |
147 | 147 | } |
148 | 148 | |
149 | 149 |
@@ -322,7 +322,7 @@ EOD; | ||
322 | 322 | if (PKWK_ALLOW_RELATIVE_FOOTNOTE_ANCHOR) { |
323 | 323 | $script = ''; |
324 | 324 | } else { |
325 | - $script = get_script_uri() . '?' . pagename_urlencode($page); | |
325 | + $script = get_page_uri($page); | |
326 | 326 | } |
327 | 327 | |
328 | 328 | $id = ++$note_id; |
@@ -30,9 +30,9 @@ function exist_plugin($name) | ||
30 | 30 | die('Alert: plugin "' . htmlsc($name) . |
31 | 31 | '" was called over ' . PKWK_PLUGIN_CALL_TIME_LIMIT . |
32 | 32 | ' times. SPAM or someting?<br />' . "\n" . |
33 | - '<a href="' . get_script_uri() . '?cmd=edit&page='. | |
33 | + '<a href="' . get_base_uri() . '?cmd=edit&page='. | |
34 | 34 | 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>'); | |
36 | 36 | return $exist[$name]; |
37 | 37 | } |
38 | 38 |
@@ -102,7 +102,7 @@ function plugin_aname_tag($args = array(), $convert = TRUE) | ||
102 | 102 | $id = htmlsc($id); // Insurance |
103 | 103 | $class = $f_super ? 'anchor_super' : 'anchor'; |
104 | 104 | $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']) : ''; | |
106 | 106 | if ($body != '') { |
107 | 107 | $href = ' href="' . $url . '#' . $id . '"'; |
108 | 108 | $title = ' title="' . $id . '"'; |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // backup.inc.php |
4 | -// Copyright (C) | |
5 | -// 2002-2016 PukiWiki Development Team | |
4 | +// Copyright | |
5 | +// 2002-2017 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -40,7 +40,7 @@ function plugin_backup_action() | ||
40 | 40 | $s_age = (isset($vars['age']) && is_numeric($vars['age'])) ? $vars['age'] : 0; |
41 | 41 | if ($s_age <= 0) return array( 'msg'=>$_title_pagebackuplist, 'body'=>plugin_backup_get_list($page)); |
42 | 42 | |
43 | - $script = get_script_uri(); | |
43 | + $script = get_base_uri(); | |
44 | 44 | |
45 | 45 | $body = '<ul>' . "\n"; |
46 | 46 | $body .= ' <li><a href="' . $script . '?cmd=backup">' . $_msg_backuplist . '</a></li>' ."\n"; |
@@ -144,7 +144,7 @@ function plugin_backup_delete($page) | ||
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
147 | - $script = get_script_uri(); | |
147 | + $script = get_base_uri(); | |
148 | 148 | $s_page = htmlsc($page); |
149 | 149 | $body .= <<<EOD |
150 | 150 | <p>$_msg_backup_adminpass</p> |
@@ -180,7 +180,7 @@ function plugin_backup_get_list($page) | ||
180 | 180 | global $_msg_backuplist, $_msg_diff, $_msg_nowdiff, $_msg_source, $_msg_nobackup; |
181 | 181 | global $_title_backup_delete; |
182 | 182 | |
183 | - $script = get_script_uri(); | |
183 | + $script = get_base_uri(); | |
184 | 184 | $r_page = rawurlencode($page); |
185 | 185 | $s_page = htmlsc($page); |
186 | 186 | $retval = array(); |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | - | |
3 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
4 | -// Copyright (C) 2016 PukiWiki Development Team | |
3 | +// basicauthlogout.inc.php | |
4 | +// Copyright 2016-2017 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // "Basic auth logout" plugin |
@@ -9,7 +9,7 @@ | ||
9 | 9 | function plugin_basicauthlogout_inline() |
10 | 10 | { |
11 | 11 | $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>'; | |
13 | 13 | } |
14 | 14 | |
15 | 15 | function plugin_basicauthlogout_convert() |
@@ -99,7 +99,7 @@ function plugin_bugtrack_print_form($base, $category) | ||
99 | 99 | $encoded_category .= '</select>'; |
100 | 100 | } |
101 | 101 | |
102 | - $script = get_script_uri(); | |
102 | + $script = get_base_uri(); | |
103 | 103 | $s_base = htmlsc($base); |
104 | 104 | $s_name = htmlsc($_plugin_bugtrack['name']); |
105 | 105 | $s_category = htmlsc($_plugin_bugtrack['category']); |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // comment.inc.php |
4 | 4 | // Copyright |
5 | -// 2002-2016 PukiWiki Development Team | |
5 | +// 2002-2017 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -114,7 +114,7 @@ function plugin_comment_convert() | ||
114 | 114 | $above = in_array('above', $options) ? '1' : |
115 | 115 | (in_array('below', $options) ? '0' : PLUGIN_COMMENT_DIRECTION_DEFAULT); |
116 | 116 | |
117 | - $script = get_script_uri(); | |
117 | + $script = get_base_uri(); | |
118 | 118 | $s_page = htmlsc($vars['page']); |
119 | 119 | $string = <<<EOD |
120 | 120 | <br /> |
@@ -169,7 +169,7 @@ function plugin_edit_inline() | ||
169 | 169 | } |
170 | 170 | |
171 | 171 | // URL |
172 | - $script = get_script_uri(); | |
172 | + $script = get_base_uri(); | |
173 | 173 | if ($isfreeze) { |
174 | 174 | $url = $script . '?cmd=unfreeze&page=' . rawurlencode($s_page); |
175 | 175 | } else { |
@@ -1,7 +1,6 @@ | ||
1 | 1 | <?php |
2 | - | |
3 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
4 | -// Copyright (C) 2015 PukiWiki Development Team | |
3 | +// Copyright 2015-2017 PukiWiki Development Team | |
5 | 4 | // License: GPL v2 or (at your option) any later version |
6 | 5 | // |
7 | 6 | // "Login form" plugin |
@@ -9,7 +8,7 @@ | ||
9 | 8 | function plugin_loginform_inline() |
10 | 9 | { |
11 | 10 | $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>'; | |
13 | 12 | } |
14 | 13 | |
15 | 14 | function plugin_loginform_convert() |
@@ -27,7 +26,7 @@ function plugin_loginform_action() | ||
27 | 26 | if (!$url_after_login) { |
28 | 27 | $page_after_login = $page; |
29 | 28 | } |
30 | - $action_url = get_script_uri() . '?plugin=loginform' | |
29 | + $action_url = get_base_uri() . '?plugin=loginform' | |
31 | 30 | . '&page=' . rawurlencode($page) |
32 | 31 | . ($url_after_login ? '&url_after_login=' . rawurlencode($url_after_login) : '') |
33 | 32 | . ($page_after_login ? '&page_after_login=' . rawurlencode($page_after_login) : ''); |
@@ -59,7 +58,7 @@ function plugin_loginform_action() | ||
59 | 58 | return array( |
60 | 59 | 'msg' => 'Log out', |
61 | 60 | 'body' => 'Logged out completely<br>' |
62 | - . '<a href="'. get_script_uri() . '?' . pagename_urlencode($page) . '">' | |
61 | + . '<a href="'. get_page_uri($page) . '">' | |
63 | 62 | . $page . '</a>' |
64 | 63 | ); |
65 | 64 | } else { |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // 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 | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -26,7 +26,7 @@ function plugin_lookup_convert() | ||
26 | 26 | $s_page = htmlsc($vars['page']); |
27 | 27 | ++$id; |
28 | 28 | |
29 | - $script = get_script_uri(); | |
29 | + $script = get_base_uri(); | |
30 | 30 | $ret = <<<EOD |
31 | 31 | <form action="$script" method="post"> |
32 | 32 | <div> |
@@ -62,4 +62,3 @@ function plugin_lookup_action() | ||
62 | 62 | header('Location: ' . $url); // Publish as GET method |
63 | 63 | exit; |
64 | 64 | } |
65 | -?> |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // 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 | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // MD5 plugin: Allow to convert password/passphrase |
@@ -70,7 +70,7 @@ function plugin_md5_show_form($nophrase = FALSE, $value = '') | ||
70 | 70 | $md5_checked = 'checked="checked" '; |
71 | 71 | } |
72 | 72 | |
73 | - $self = get_script_uri(); | |
73 | + $self = get_base_uri(); | |
74 | 74 | |
75 | 75 | $form = <<<EOD |
76 | 76 | <p><strong>NOTICE: Don't use this feature via untrustful or unsure network</strong></p> |
@@ -131,4 +131,3 @@ EOD; | ||
131 | 131 | |
132 | 132 | return $form; |
133 | 133 | } |
134 | -?> |
@@ -133,7 +133,7 @@ function plugin_pcomment_convert() | ||
133 | 133 | $s_nodate = htmlsc($params['nodate']); |
134 | 134 | $s_count = htmlsc($count); |
135 | 135 | |
136 | - $form_start = '<form action="' . get_script_uri() . '" method="post">' . "\n"; | |
136 | + $form_start = '<form action="' . get_base_uri() . '" method="post">' . "\n"; | |
137 | 137 | $form = <<<EOD |
138 | 138 | <div> |
139 | 139 | <input type="hidden" name="digest" value="$digest" /> |
@@ -1,9 +1,10 @@ | ||
1 | 1 | <?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 | |
5 | 6 | // 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 | |
7 | 8 | // |
8 | 9 | // Recent plugin -- Show RecentChanges list |
9 | 10 | // * Usually used at 'MenuBar' page |
@@ -54,8 +55,6 @@ function plugin_recent_convert() | ||
54 | 55 | // Get latest N changes |
55 | 56 | $lines = file_head(PLUGIN_RECENT_CACHE, $recent_lines); |
56 | 57 | if ($lines == FALSE) return '#recent(): File can not open' . '<br />' . "\n"; |
57 | - | |
58 | - $script = get_script_uri(); | |
59 | 58 | $date = $items = ''; |
60 | 59 | foreach ($lines as $line) { |
61 | 60 | list($time, $page) = explode("\t", rtrim($line)); |
@@ -77,9 +76,8 @@ function plugin_recent_convert() | ||
77 | 76 | // No need to link to the page you just read, or notify where you just read |
78 | 77 | $items .= ' <li>' . $s_page . '</li>' . "\n"; |
79 | 78 | } else { |
80 | - $r_page = pagename_urlencode($page); | |
81 | 79 | $passage = $show_passage ? ' ' . get_passage($time) : ''; |
82 | - $items .= ' <li><a href="' . $script . '?' . $r_page . '"' . | |
80 | + $items .= ' <li><a href="' . get_page_uri($page) . '"' . | |
83 | 81 | ' title="' . $s_page . $passage . '">' . $s_page . '</a></li>' . "\n"; |
84 | 82 | } |
85 | 83 | } |
@@ -88,4 +86,3 @@ function plugin_recent_convert() | ||
88 | 86 | |
89 | 87 | return sprintf($_recent_plugin_frame, count($lines), $items); |
90 | 88 | } |
91 | - |
@@ -34,7 +34,6 @@ function plugin_topicpath_inline() | ||
34 | 34 | { |
35 | 35 | global $vars, $defaultpage; |
36 | 36 | |
37 | - $script = get_script_uri(); | |
38 | 37 | $page = isset($vars['page']) ? $vars['page'] : ''; |
39 | 38 | if ($page == '' || $page == $defaultpage) return ''; |
40 | 39 |
@@ -50,7 +49,6 @@ function plugin_topicpath_inline() | ||
50 | 49 | $topic_path = array(); |
51 | 50 | while (! empty($parts)) { |
52 | 51 | $_landing = join('/', $parts); |
53 | - $landing = pagename_urlencode($_landing); | |
54 | 52 | $element = htmlsc(array_pop($parts)); |
55 | 53 | if (! $b_link) { |
56 | 54 | // This page ($_landing == $page) |
@@ -61,7 +59,7 @@ function plugin_topicpath_inline() | ||
61 | 59 | $topic_path[] = $element; |
62 | 60 | } else { |
63 | 61 | // Page exists or not exists |
64 | - $topic_path[] = '<a href="' . $script . '?' . $landing . '">' . | |
62 | + $topic_path[] = '<a href="' . get_page_uri($_landing) . '">' . | |
65 | 63 | $element . '</a>'; |
66 | 64 | } |
67 | 65 | } |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // 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 | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Yet list plugin - Show a list of dangling links (not yet created) |
@@ -23,7 +23,7 @@ function plugin_yetlist_action() | ||
23 | 23 | $empty = TRUE; |
24 | 24 | |
25 | 25 | // Load .ref files and Output |
26 | - $script = get_script_uri(); | |
26 | + $script = get_base_uri(); | |
27 | 27 | $refer_regex = '/' . $non_list . '|^' . preg_quote($whatsdeleted, '/') . '$/S'; |
28 | 28 | asort($pages, SORT_STRING); |
29 | 29 | foreach ($pages as $file=>$page) { |
@@ -43,7 +43,7 @@ function plugin_yetlist_action() | ||
43 | 43 | $link_refs = array(); |
44 | 44 | foreach ($refer as $_refer) { |
45 | 45 | $r_refer = pagename_urlencode($_refer); |
46 | - $link_refs[] = '<a href="' . $script . '?' . $r_refer . '">' . | |
46 | + $link_refs[] = '<a href="' . get_page_uri($_refer) . '">' . | |
47 | 47 | htmlsc($_refer) . '</a>'; |
48 | 48 | } |
49 | 49 | $link_ref = join(' ', $link_refs); |
@@ -73,4 +73,3 @@ function plugin_yetlist_action() | ||
73 | 73 | |
74 | 74 | return $retval; |
75 | 75 | } |
76 | - |