Revision | 8e51d1f11315c953388d8c27e58ead9c167b5c42 (tree) |
---|---|
Time | 2017-09-03 11:51:11 |
Author | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2260 Use get_script_uri() instead of $script
@@ -157,7 +157,7 @@ function pkwk_ldap_escape_dn($value) { | ||
157 | 157 | // Check edit-permission |
158 | 158 | function check_editable($page, $auth_enabled = TRUE, $exit_on_fail = TRUE) |
159 | 159 | { |
160 | - global $script, $_title_cannotedit, $_msg_unfreeze; | |
160 | + global $_title_cannotedit, $_msg_unfreeze; | |
161 | 161 | |
162 | 162 | if (edit_auth($page, $auth_enabled, $exit_on_fail) && is_editable($page)) { |
163 | 163 | // Editable |
@@ -171,7 +171,7 @@ function check_editable($page, $auth_enabled = TRUE, $exit_on_fail = TRUE) | ||
171 | 171 | $body = $title = str_replace('$1', |
172 | 172 | htmlsc(strip_bracket($page)), $_title_cannotedit); |
173 | 173 | if (is_freeze($page)) |
174 | - $body .= '(<a href="' . $script . '?cmd=unfreeze&page=' . | |
174 | + $body .= '(<a href="' . get_script_uri() . '?cmd=unfreeze&page=' . | |
175 | 175 | rawurlencode($page) . '">' . $_msg_unfreeze . '</a>)'; |
176 | 176 | $page = str_replace('$1', make_search($page), $_title_cannotedit); |
177 | 177 | catbody($title, $page, $body); |
@@ -301,7 +301,7 @@ function get_search_words($words = array(), $do_escape = FALSE) | ||
301 | 301 | // 'Search' main function |
302 | 302 | function do_search($word, $type = 'AND', $non_format = FALSE, $base = '') |
303 | 303 | { |
304 | - global $script, $whatsnew, $non_list, $search_non_list; | |
304 | + global $whatsnew, $non_list, $search_non_list; | |
305 | 305 | global $_msg_andresult, $_msg_orresult, $_msg_notfoundresult; |
306 | 306 | global $search_auth, $show_passage; |
307 | 307 |
@@ -366,7 +366,7 @@ function do_search($word, $type = 'AND', $non_format = FALSE, $base = '') | ||
366 | 366 | $r_page = rawurlencode($page); |
367 | 367 | $s_page = htmlsc($page); |
368 | 368 | $passage = $show_passage ? ' ' . get_passage(get_filetime($page)) : ''; |
369 | - $retval .= ' <li><a href="' . $script . '?cmd=read&page=' . | |
369 | + $retval .= ' <li><a href="' . get_script_uri() . '?cmd=read&page=' . | |
370 | 370 | $r_page . '&word=' . $r_word . '">' . $s_page . |
371 | 371 | '</a>' . $passage . '</li>' . "\n"; |
372 | 372 | } |
@@ -433,10 +433,12 @@ function strip_bracket($str) | ||
433 | 433 | // Create list of pages |
434 | 434 | function page_list($pages, $cmd = 'read', $withfilename = FALSE) |
435 | 435 | { |
436 | - global $script, $list_index; | |
436 | + global $list_index; | |
437 | 437 | global $_msg_symbol, $_msg_other; |
438 | 438 | global $pagereading_enable; |
439 | 439 | |
440 | + $script = get_script_uri(); | |
441 | + | |
440 | 442 | // ソートキーを決定する。 ' ' < '[a-zA-Z]' < 'zz'という前提。 |
441 | 443 | $symbol = ' '; |
442 | 444 | $other = 'zz'; |
@@ -11,7 +11,7 @@ | ||
11 | 11 | // Show page-content |
12 | 12 | function catbody($title, $page, $body) |
13 | 13 | { |
14 | - global $script, $vars, $arg, $defaultpage, $whatsnew, $help_page, $hr; | |
14 | + global $vars, $arg, $defaultpage, $whatsnew, $help_page, $hr; | |
15 | 15 | global $attach_link, $related_link, $cantedit, $function_freeze; |
16 | 16 | global $search_word_color, $_msg_word, $foot_explain, $note_hr, $head_tags; |
17 | 17 | global $javascript, $nofollow; |
@@ -24,6 +24,7 @@ function catbody($title, $page, $body) | ||
24 | 24 | global $modifier; // Site administrator's web page |
25 | 25 | global $modifierlink; // Site administrator's name |
26 | 26 | |
27 | + $script = get_script_uri(); | |
27 | 28 | $enable_login = false; |
28 | 29 | $enable_logout = false; |
29 | 30 | if (AUTH_TYPE_FORM === $auth_type || AUTH_TYPE_EXTERNAL === $auth_type || |
@@ -232,13 +233,14 @@ EOS; | ||
232 | 233 | // Show 'edit' form |
233 | 234 | function edit_form($page, $postdata, $digest = FALSE, $b_template = TRUE) |
234 | 235 | { |
235 | - global $script, $vars, $rows, $cols, $hr, $function_freeze; | |
236 | + global $vars, $rows, $cols, $hr, $function_freeze; | |
236 | 237 | global $_btn_preview, $_btn_repreview, $_btn_update, $_btn_cancel, $_msg_help; |
237 | 238 | global $whatsnew, $_btn_template, $_btn_load, $load_template_func; |
238 | 239 | global $notimeupdate; |
239 | 240 | global $_title_list, $_label_template_pages; |
240 | 241 | global $rule_page; |
241 | 242 | |
243 | + $script = get_script_uri(); | |
242 | 244 | // Newly generate $digest or not |
243 | 245 | if ($digest === FALSE) $digest = md5(join('', get_source($page))); |
244 | 246 |
@@ -379,8 +381,9 @@ EOD; | ||
379 | 381 | // Related pages |
380 | 382 | function make_related($page, $tag = '') |
381 | 383 | { |
382 | - global $script, $vars, $rule_related_str, $related_str; | |
384 | + global $vars, $rule_related_str, $related_str; | |
383 | 385 | |
386 | + $script = get_script_uri(); | |
384 | 387 | prepare_links_related($page); |
385 | 388 | $links = links_get_related($page); |
386 | 389 |
@@ -466,12 +469,9 @@ function strip_autolink($str) | ||
466 | 469 | // Make a backlink. searching-link of the page name, by the page name, for the page name |
467 | 470 | function make_search($page) |
468 | 471 | { |
469 | - global $script; | |
470 | - | |
471 | 472 | $s_page = htmlsc($page); |
472 | 473 | $r_page = rawurlencode($page); |
473 | - | |
474 | - return '<a href="' . $script . '?plugin=related&page=' . $r_page . | |
474 | + return '<a href="' . get_script_uri() . '?plugin=related&page=' . $r_page . | |
475 | 475 | '">' . $s_page . '</a> '; |
476 | 476 | } |
477 | 477 |
@@ -541,8 +541,6 @@ EOD; | ||
541 | 541 | |
542 | 542 | function set($arr, $page) |
543 | 543 | { |
544 | - global $script; | |
545 | - | |
546 | 544 | list(, $alias, , $name, $this->param) = $this->splice($arr); |
547 | 545 | |
548 | 546 | $matches = array(); |
@@ -551,7 +549,7 @@ EOD; | ||
551 | 549 | |
552 | 550 | $url = get_interwiki_url($name, $this->param); |
553 | 551 | $this->url = ($url === FALSE) ? |
554 | - $script . '?' . pagename_urlencode('[[' . $name . ':' . $this->param . ']]') : | |
552 | + get_script_uri() . '?' . pagename_urlencode('[[' . $name . ':' . $this->param . ']]') : | |
555 | 553 | htmlsc($url); |
556 | 554 | |
557 | 555 | return parent::setParam( |
@@ -754,8 +752,9 @@ class Link_autolink_a extends Link_autolink | ||
754 | 752 | // Make hyperlink for the page |
755 | 753 | function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolink = FALSE) |
756 | 754 | { |
757 | - global $script, $vars, $link_compact, $related, $_symbol_noexists; | |
755 | + global $vars, $link_compact, $related, $_symbol_noexists; | |
758 | 756 | |
757 | + $script = get_script_uri(); | |
759 | 758 | $s_page = htmlsc(strip_bracket($page)); |
760 | 759 | $s_alias = ($alias == '') ? $s_page : $alias; |
761 | 760 |
@@ -112,8 +112,9 @@ EOD; | ||
112 | 112 | |
113 | 113 | function plugin_amazon_convert() |
114 | 114 | { |
115 | - global $script, $vars, $asin, $asin_all; | |
115 | + global $vars, $asin, $asin_all; | |
116 | 116 | |
117 | + $script = get_script_uri(); | |
117 | 118 | if (func_num_args() > 3) { |
118 | 119 | if (PKWK_READONLY) return ''; // Show nothing |
119 | 120 |
@@ -187,7 +188,7 @@ EOD; | ||
187 | 188 | |
188 | 189 | function plugin_amazon_action() |
189 | 190 | { |
190 | - global $vars, $script, $edit_auth, $edit_auth_users; | |
191 | + global $vars, $edit_auth, $edit_auth_users; | |
191 | 192 | global $amazon_body, $asin, $asin_all; |
192 | 193 | |
193 | 194 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
@@ -1,7 +1,8 @@ | ||
1 | 1 | <?php |
2 | -// $Id: article.inc.php,v 1.28 2011/01/25 15:01:01 henoheno Exp $ | |
3 | -// Copyright (C) | |
4 | -// 2002-2005 PukiWiki Developers Team | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone | |
3 | +// article.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2017 PukiWiki Development Team | |
5 | 6 | // 2002 Originally written by OKAWARA,Satoshi <kawara@dml.co.jp> |
6 | 7 | // http://www.dml.co.jp/~kawara/pukiwiki/pukiwiki.php |
7 | 8 | // |
@@ -45,11 +46,12 @@ $_plugin_article_mailto = array ( | ||
45 | 46 | |
46 | 47 | function plugin_article_action() |
47 | 48 | { |
48 | - global $script, $post, $vars, $cols, $rows, $now; | |
49 | + global $post, $vars, $cols, $rows, $now; | |
49 | 50 | global $_title_collided, $_msg_collided, $_title_updated; |
50 | 51 | global $_plugin_article_mailto, $_no_subject, $_no_name; |
51 | 52 | global $_msg_article_mail_sender, $_msg_article_mail_page; |
52 | 53 | |
54 | + $script = get_script_uri(); | |
53 | 55 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
54 | 56 | |
55 | 57 | if ($post['msg'] == '') |
@@ -121,7 +123,7 @@ EOD; | ||
121 | 123 | $mailbody .= "\n\n" . '---' . "\n"; |
122 | 124 | $mailbody .= $_msg_article_mail_sender . $post['name'] . ' (' . $now . ')' . "\n"; |
123 | 125 | $mailbody .= $_msg_article_mail_page . $post['refer'] . "\n"; |
124 | - $mailbody .= ' URL: ' . $script . '?' . pagename_urlencode($post['refer']) . "\n"; | |
126 | + $mailbody .= ' URL: ' . get_script_uri(PKWK_URI_ABSOLUTE) . '?' . pagename_urlencode($post['refer']) . "\n"; | |
125 | 127 | $mailbody = mb_convert_encoding($mailbody, 'JIS'); |
126 | 128 | |
127 | 129 | $mailaddheader = 'From: ' . PLUGIN_ARTICLE_MAIL_FROM; |
@@ -142,10 +144,11 @@ EOD; | ||
142 | 144 | |
143 | 145 | function plugin_article_convert() |
144 | 146 | { |
145 | - global $script, $vars, $digest; | |
147 | + global $vars, $digest; | |
146 | 148 | global $_btn_article, $_btn_name, $_btn_subject; |
147 | 149 | static $numbers = array(); |
148 | 150 | |
151 | + $script = get_script_uri(); | |
149 | 152 | if (PKWK_READONLY) return ''; // Show nothing |
150 | 153 | |
151 | 154 | if (! isset($numbers[$vars['page']])) $numbers[$vars['page']] = 0; |
@@ -177,4 +180,3 @@ EOD; | ||
177 | 180 | |
178 | 181 | return $string; |
179 | 182 | } |
180 | - |
@@ -380,8 +380,9 @@ function attach_mime_content_type($filename, $displayname) | ||
380 | 380 | // アップロードフォームの出力 |
381 | 381 | function attach_form($page) |
382 | 382 | { |
383 | - global $script, $vars, $_attach_messages; | |
383 | + global $vars, $_attach_messages; | |
384 | 384 | |
385 | + $script = get_script_uri(); | |
385 | 386 | $r_page = rawurlencode($page); |
386 | 387 | $s_page = htmlsc($page); |
387 | 388 | $navi = <<<EOD |
@@ -496,8 +497,9 @@ class AttachFile | ||
496 | 497 | |
497 | 498 | function toString($showicon, $showinfo) |
498 | 499 | { |
499 | - global $script, $_attach_messages; | |
500 | + global $_attach_messages; | |
500 | 501 | |
502 | + $script = get_script_uri(); | |
501 | 503 | $this->getstatus(); |
502 | 504 | $param = '&file=' . rawurlencode($this->file) . '&refer=' . rawurlencode($this->page) . |
503 | 505 | ($this->age ? '&age=' . $this->age : ''); |
@@ -519,8 +521,9 @@ class AttachFile | ||
519 | 521 | // 情報表示 |
520 | 522 | function info($err) |
521 | 523 | { |
522 | - global $script, $_attach_messages; | |
524 | + global $_attach_messages; | |
523 | 525 | |
526 | + $script = get_script_uri(); | |
524 | 527 | $r_page = rawurlencode($this->page); |
525 | 528 | $s_page = htmlsc($this->page); |
526 | 529 | $s_file = htmlsc($this->file); |
@@ -1,7 +1,8 @@ | ||
1 | 1 | <?php |
2 | -// $Id: calendar.inc.php,v 1.22 2011/01/25 15:01:01 henoheno Exp $ | |
3 | -// Copyright (C) | |
4 | -// 2002-2003,2005 PukiWiki Developers Team | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone | |
3 | +// calendar.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2017 PukiWiki Development Team | |
5 | 6 | // 2001-2002 Originally written by yu-ji |
6 | 7 | // License: GPL v2 or (at your option) any later version |
7 | 8 | // |
@@ -9,8 +10,9 @@ | ||
9 | 10 | |
10 | 11 | function plugin_calendar_convert() |
11 | 12 | { |
12 | - global $script, $weeklabels, $vars, $command; | |
13 | + global $weeklabels, $vars, $command; | |
13 | 14 | |
15 | + $script = get_script_uri(); | |
14 | 16 | $args = func_get_args(); |
15 | 17 | $date_str = get_date('Ym'); |
16 | 18 | $page = ''; |
@@ -68,7 +70,7 @@ function plugin_calendar_convert() | ||
68 | 70 | |
69 | 71 | $m_name = $year . '.' . $m_num . ' (' . $cmd . ')'; |
70 | 72 | |
71 | - $prefix_url = rawurlencode(is_pagename($pre) ? $pre : '[[' . $pre . ']]'); | |
73 | + $prefix_url = pagename_urlencode($pre); | |
72 | 74 | $pre = strip_bracket($pre); |
73 | 75 | |
74 | 76 | $ret = <<<EOD |
@@ -149,4 +151,3 @@ EOD; | ||
149 | 151 | |
150 | 152 | return $ret; |
151 | 153 | } |
152 | -?> |
@@ -1,5 +1,9 @@ | ||
1 | 1 | <?php |
2 | -// $Id: calendar2.inc.php,v 1.24 2011/01/25 15:01:01 henoheno Exp $ | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone | |
3 | +// calendar2.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2017 PukiWiki Development Team | |
6 | +// License: GPL v2 or (at your option) any later version | |
3 | 7 | // |
4 | 8 | // Calendar2 plugin |
5 | 9 | // |
@@ -9,9 +13,10 @@ | ||
9 | 13 | |
10 | 14 | function plugin_calendar2_convert() |
11 | 15 | { |
12 | - global $script, $vars, $post, $get, $weeklabels, $WikiName, $BracketName; | |
16 | + global $vars, $post, $get, $weeklabels, $WikiName, $BracketName; | |
13 | 17 | global $_calendar2_plugin_edit, $_calendar2_plugin_empty; |
14 | 18 | |
19 | + $script = get_script_uri(); | |
15 | 20 | $date_str = get_date('Ym'); |
16 | 21 | $base = strip_bracket($vars['page']); |
17 | 22 |
@@ -197,4 +202,3 @@ function plugin_calendar2_action() | ||
197 | 202 | |
198 | 203 | return $ret; |
199 | 204 | } |
200 | - |
@@ -20,7 +20,7 @@ define('PLUGIN_COMMENT_FORMAT_STRING', "\x08MSG\x08 -- \x08NAME\x08 \x08NOW\x08" | ||
20 | 20 | |
21 | 21 | function plugin_comment_action() |
22 | 22 | { |
23 | - global $script, $vars, $now, $_title_updated, $_no_name; | |
23 | + global $vars, $now, $_title_updated, $_no_name; | |
24 | 24 | global $_msg_comment_collided, $_title_comment_collided; |
25 | 25 | global $_comment_plugin_fail_msg; |
26 | 26 |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: diff.inc.php,v 1.20 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) | |
5 | -// 2002-2005 PukiWiki Developers Team | |
3 | +// diff.inc.php | |
4 | +// Copyright | |
5 | +// 2002-2017 PukiWiki Development Team | |
6 | 6 | // 2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -25,10 +25,11 @@ function plugin_diff_action() | ||
25 | 25 | |
26 | 26 | function plugin_diff_view($page) |
27 | 27 | { |
28 | - global $script, $hr; | |
28 | + global $hr; | |
29 | 29 | global $_msg_notfound, $_msg_goto, $_msg_deleted, $_msg_addline, $_msg_delline, $_title_diff; |
30 | 30 | global $_title_diff_delete; |
31 | 31 | |
32 | + $script = get_script_uri(); | |
32 | 33 | $r_page = pagename_urlencode($page); |
33 | 34 | $s_page = htmlsc($page); |
34 | 35 |
@@ -72,10 +73,11 @@ EOD; | ||
72 | 73 | |
73 | 74 | function plugin_diff_delete($page) |
74 | 75 | { |
75 | - global $script, $vars; | |
76 | + global $vars; | |
76 | 77 | global $_title_diff_delete, $_msg_diff_deleted; |
77 | 78 | global $_msg_diff_adminpass, $_btn_delete, $_msg_invalidpass; |
78 | 79 | |
80 | + $script = get_script_uri(); | |
79 | 81 | $filename = DIFF_DIR . encode($page) . '.txt'; |
80 | 82 | $body = ''; |
81 | 83 | if (! is_pagename($page)) $body = 'Invalid page name'; |
@@ -110,4 +112,3 @@ EOD; | ||
110 | 112 | |
111 | 113 | return array('msg'=>$_title_diff_delete, 'body'=>$body); |
112 | 114 | } |
113 | - |
@@ -216,8 +216,9 @@ function download_tarfile($tempnam, $arc_kind) | ||
216 | 216 | // 入力フォームを表示 |
217 | 217 | function plugin_dump_disp_form() |
218 | 218 | { |
219 | - global $script, $defaultpage; | |
219 | + global $defaultpage; | |
220 | 220 | |
221 | + $script = get_script_uri(); | |
221 | 222 | $act_down = PLUGIN_DUMP_DUMP; |
222 | 223 | $act_up = PLUGIN_DUMP_RESTORE; |
223 | 224 | $maxsize = PLUGIN_DUMP_MAX_FILESIZE; |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: freeze.inc.php,v 1.12 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright: 2003-2004, 2007 PukiWiki Developers Team | |
3 | +// freeze.inc.php | |
4 | +// Copyright 2003-2017 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Freeze(Lock) plugin |
@@ -11,10 +11,11 @@ function plugin_freeze_convert() { return ''; } | ||
11 | 11 | |
12 | 12 | function plugin_freeze_action() |
13 | 13 | { |
14 | - global $script, $vars, $function_freeze; | |
14 | + global $vars, $function_freeze; | |
15 | 15 | global $_title_isfreezed, $_title_freezed, $_title_freeze; |
16 | 16 | global $_msg_invalidpass, $_msg_freezing, $_btn_freeze; |
17 | 17 | |
18 | + $script = get_script_uri(); | |
18 | 19 | $page = isset($vars['page']) ? $vars['page'] : ''; |
19 | 20 | if (! $function_freeze || ! is_page($page)) |
20 | 21 | return array('msg' => '', 'body' => ''); |
@@ -59,4 +60,3 @@ EOD; | ||
59 | 60 | |
60 | 61 | return array('msg'=>$msg, 'body'=>$body); |
61 | 62 | } |
62 | -?> |
@@ -1,6 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: include.inc.php,v 1.23 2011/01/25 15:01:01 henoheno Exp $ | |
3 | +// include.inc.php | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
5 | +// License: GPL v2 or (at your option) any later version | |
4 | 6 | // |
5 | 7 | // Include-once plugin |
6 | 8 |
@@ -52,10 +54,11 @@ define('PLUGIN_INCLUDE_USAGE', '#include(): Usage: (a-page-name-you-want-to-incl | ||
52 | 54 | |
53 | 55 | function plugin_include_convert() |
54 | 56 | { |
55 | - global $script, $vars, $get, $post, $menubar, $_msg_include_restrict; | |
57 | + global $vars, $get, $post, $menubar, $_msg_include_restrict; | |
56 | 58 | static $included = array(); |
57 | 59 | static $count = 1; |
58 | 60 | |
61 | + $script = get_script_uri(); | |
59 | 62 | if (func_num_args() == 0) return PLUGIN_INCLUDE_USAGE . '<br />' . "\n";; |
60 | 63 | |
61 | 64 | // $menubar will already be shown via menu plugin |
@@ -1,14 +1,16 @@ | ||
1 | 1 | <?php |
2 | -// $Id: includesubmenu.inc.php,v 1.7 2011/01/25 15:01:01 henoheno Exp $ | |
3 | -// Copyright (C) 2002-2004, 2007 PukiWiki Developers Team | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone. | |
3 | +// includesubmenu.inc | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
4 | 5 | // License: GPL v2 or (at your option) any later version |
5 | 6 | // |
6 | 7 | // Including submenu |
7 | 8 | |
8 | 9 | function plugin_includesubmenu_convert() |
9 | 10 | { |
10 | - global $script,$vars; | |
11 | + global $vars; | |
11 | 12 | |
13 | + $script = get_script_uri(); | |
12 | 14 | $ShowPageName = FALSE; |
13 | 15 | |
14 | 16 | if (func_num_args()) { |
@@ -58,4 +60,3 @@ function plugin_includesubmenu_convert() | ||
58 | 60 | } |
59 | 61 | return $body; |
60 | 62 | } |
61 | -?> |
@@ -1,5 +1,8 @@ | ||
1 | 1 | <?php |
2 | -// $Id: insert.inc.php,v 1.16 2011/01/25 15:01:01 henoheno Exp $ | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone. | |
3 | +// insert.inc.php | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
5 | +// License: GPL v2 or (at your option) any later version | |
3 | 6 | // |
4 | 7 | // Text inserting box plugin |
5 | 8 |
@@ -9,9 +12,10 @@ define('INSERT_INS', 1); // Order of insertion (1:before the textarea, 0:after | ||
9 | 12 | |
10 | 13 | function plugin_insert_action() |
11 | 14 | { |
12 | - global $script, $vars, $cols, $rows; | |
15 | + global $vars, $cols, $rows; | |
13 | 16 | global $_title_collided, $_msg_collided, $_title_updated; |
14 | 17 | |
18 | + $script = get_script_uri(); | |
15 | 19 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
16 | 20 | if (! isset($vars['msg']) || $vars['msg'] == '') return; |
17 | 21 |
@@ -68,10 +72,11 @@ EOD; | ||
68 | 72 | |
69 | 73 | function plugin_insert_convert() |
70 | 74 | { |
71 | - global $script, $vars, $digest; | |
75 | + global $vars, $digest; | |
72 | 76 | global $_btn_insert; |
73 | 77 | static $numbers = array(); |
74 | 78 | |
79 | + $script = get_script_uri(); | |
75 | 80 | if (PKWK_READONLY) return ''; // Show nothing |
76 | 81 | |
77 | 82 | if (! isset($numbers[$vars['page']])) $numbers[$vars['page']] = 0; |
@@ -97,4 +102,3 @@ EOD; | ||
97 | 102 | |
98 | 103 | return $string; |
99 | 104 | } |
100 | -?> |
@@ -1,8 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // links.inc.php |
4 | -// Copyright | |
5 | -// 2003-2005, 2007 PukiWiki Development Team | |
4 | +// Copyright 2003-2017 PukiWiki Development Team | |
6 | 5 | // License: GPL v2 or (at your option) any later version |
7 | 6 | // |
8 | 7 | // Update link cache plugin |
@@ -35,9 +34,10 @@ function plugin_links_init() | ||
35 | 34 | |
36 | 35 | function plugin_links_action() |
37 | 36 | { |
38 | - global $script, $post, $vars, $foot_explain; | |
37 | + global $post, $vars, $foot_explain; | |
39 | 38 | global $_links_messages; |
40 | 39 | |
40 | + $script = get_script_uri(); | |
41 | 41 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits this'); |
42 | 42 | |
43 | 43 | $msg = $body = ''; |
@@ -51,7 +51,7 @@ function plugin_ls2_action() | ||
51 | 51 | |
52 | 52 | function plugin_ls2_convert() |
53 | 53 | { |
54 | - global $script, $vars, $_ls2_msg_title; | |
54 | + global $vars, $_ls2_msg_title; | |
55 | 55 | |
56 | 56 | $params = array( |
57 | 57 | 'link' => FALSE, |
@@ -85,7 +85,7 @@ function plugin_ls2_convert() | ||
85 | 85 | if (isset($params['title'])) $tmp[] = 'title=1'; |
86 | 86 | if (isset($params['include'])) $tmp[] = 'include=1'; |
87 | 87 | |
88 | - return '<p><a href="' . $script . '?' . join('&', $tmp) . '">' . | |
88 | + return '<p><a href="' . get_script_uri() . '?' . join('&', $tmp) . '">' . | |
89 | 89 | $title . '</a></p>' . "\n"; |
90 | 90 | } |
91 | 91 |
@@ -119,7 +119,6 @@ function plugin_ls2_show_lists($prefix, & $params) | ||
119 | 119 | |
120 | 120 | function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE) |
121 | 121 | { |
122 | - global $script; | |
123 | 122 | static $_ls2_anchor = 0; |
124 | 123 | |
125 | 124 | // ページが未表示のとき |
@@ -128,7 +127,7 @@ function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE) | ||
128 | 127 | |
129 | 128 | $s_page = htmlsc($page); |
130 | 129 | $title = $s_page . ' ' . get_pg_passage($page, FALSE); |
131 | - $href = $script . '?' . pagename_urlencode($page); | |
130 | + $href = get_script_uri() . '?' . pagename_urlencode($page); | |
132 | 131 | |
133 | 132 | plugin_ls2_list_push($params, $level); |
134 | 133 | $ret = $include ? '<li>include ' : '<li>'; |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // map.inc.php |
4 | -// Copyright 2002-2016 PukiWiki Development Team | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Site map plugin |
@@ -110,7 +110,7 @@ class MapNode | ||
110 | 110 | } |
111 | 111 | function __construct($page, $reverse = FALSE) |
112 | 112 | { |
113 | - global $script, $non_list; | |
113 | + global $non_list; | |
114 | 114 | |
115 | 115 | static $id = 0; |
116 | 116 |
@@ -124,7 +124,7 @@ class MapNode | ||
124 | 124 | |
125 | 125 | $this->rels = $reverse ? $this->ref() : $this->rel(); |
126 | 126 | $mark = $reverse ? '' : '<sup>+</sup>'; |
127 | - $this->mark = '<a id="rel_' . $this->id . '" href="' . $script . | |
127 | + $this->mark = '<a id="rel_' . $this->id . '" href="' . get_script_uri() . | |
128 | 128 | '?plugin=map&refer=' . rawurlencode($this->page) . '">' . |
129 | 129 | $mark . '</a>'; |
130 | 130 | } |
@@ -1,5 +1,8 @@ | ||
1 | 1 | <?php |
2 | -// $Id: memo.inc.php,v 1.17 2011/01/25 15:01:01 henoheno Exp $ | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone. | |
3 | +// memo.inc.php | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
5 | +// License: GPL v2 or (at your option) any later version | |
3 | 6 | // |
4 | 7 | // Memo box plugin |
5 | 8 |
@@ -8,9 +11,10 @@ define('MEMO_ROWS', 5); // Rows of textarea | ||
8 | 11 | |
9 | 12 | function plugin_memo_action() |
10 | 13 | { |
11 | - global $script, $vars, $cols, $rows; | |
14 | + global $vars, $cols, $rows; | |
12 | 15 | global $_title_collided, $_msg_collided, $_title_updated; |
13 | 16 | |
17 | + $script = get_script_uri(); | |
14 | 18 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
15 | 19 | if (! isset($vars['msg']) || $vars['msg'] == '') return; |
16 | 20 |
@@ -68,7 +72,7 @@ EOD; | ||
68 | 72 | |
69 | 73 | function plugin_memo_convert() |
70 | 74 | { |
71 | - global $script, $vars, $digest; | |
75 | + global $vars, $digest; | |
72 | 76 | global $_btn_memo_update; |
73 | 77 | static $numbers = array(); |
74 | 78 |
@@ -85,7 +89,7 @@ function plugin_memo_convert() | ||
85 | 89 | $_script = ''; |
86 | 90 | $_submit = ''; |
87 | 91 | } else { |
88 | - $_script = & $script; | |
92 | + $_script = get_script_uri(); | |
89 | 93 | $_submit = '<input type="submit" name="memo" value="' . $_btn_memo_update . '" />'; |
90 | 94 | } |
91 | 95 |
@@ -108,4 +112,3 @@ EOD; | ||
108 | 112 | |
109 | 113 | return $string; |
110 | 114 | } |
111 | -?> |
@@ -8,9 +8,10 @@ | ||
8 | 8 | |
9 | 9 | function plugin_newpage_convert() |
10 | 10 | { |
11 | - global $script, $vars, $_btn_edit, $_msg_newpage, $BracketName; | |
11 | + global $vars, $_btn_edit, $_msg_newpage, $BracketName; | |
12 | 12 | static $id = 0; |
13 | 13 | |
14 | + $script = get_script_uri(); | |
14 | 15 | if (PKWK_READONLY) return ''; // Show nothing |
15 | 16 | |
16 | 17 | $newpage = ''; |
@@ -1,8 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // paint.inc.php |
4 | -// Copyright | |
5 | -// 2002-2016 PukiWiki Development Team | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
6 | 5 | // License: GPL v2 or (at your option) any later version |
7 | 6 | // |
8 | 7 | // Paint plugin |
@@ -40,8 +39,9 @@ define('PAINT_FORMAT_NOMSG',"\x08NAME\x08 \x08NOW\x08"); | ||
40 | 39 | |
41 | 40 | function plugin_paint_action() |
42 | 41 | { |
43 | - global $script, $vars, $_paint_messages; | |
42 | + global $vars, $_paint_messages; | |
44 | 43 | |
44 | + $script = get_script_uri(); | |
45 | 45 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
46 | 46 | |
47 | 47 | //戻り値を初期化 |
@@ -151,10 +151,11 @@ EOD; | ||
151 | 151 | |
152 | 152 | function plugin_paint_convert() |
153 | 153 | { |
154 | - global $script,$vars,$digest; | |
154 | + global $vars,$digest; | |
155 | 155 | global $_paint_messages; |
156 | 156 | static $numbers = array(); |
157 | 157 | |
158 | + $script = get_script_uri(); | |
158 | 159 | if (PKWK_READONLY) return ''; // Show nothing |
159 | 160 | |
160 | 161 | if (!array_key_exists($vars['page'],$numbers)) |
@@ -207,7 +208,7 @@ EOD; | ||
207 | 208 | } |
208 | 209 | function paint_insert_ref($filename) |
209 | 210 | { |
210 | - global $script,$vars,$now,$do_backup; | |
211 | + global $vars,$now,$do_backup; | |
211 | 212 | global $_paint_messages,$_no_name; |
212 | 213 | |
213 | 214 | $ret['msg'] = $_paint_messages['msg_title']; |
@@ -1,9 +1,10 @@ | ||
1 | 1 | <?php |
2 | -///////////////////////////////////////////////// | |
3 | -// PukiWiki - Yet another WikiWikiWeb clone. | |
4 | -// | |
5 | -// $Id: random.inc.php,v 1.9 2011/01/25 15:01:01 henoheno Exp $ | |
2 | +// PukiWiki - Yet another WikiWikiWeb clone | |
3 | +// random.inc.php | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
5 | +// License: GPL v2 or (at your option) any later version | |
6 | 6 | // |
7 | +// Show random page plugin | |
7 | 8 | |
8 | 9 | /* |
9 | 10 | *プラグイン random |
@@ -20,8 +21,9 @@ | ||
20 | 21 | |
21 | 22 | function plugin_random_convert() |
22 | 23 | { |
23 | - global $script, $vars; | |
24 | + global $vars; | |
24 | 25 | |
26 | + $script = $get_script_uri(); | |
25 | 27 | $title = '[Random Link]'; // default |
26 | 28 | if (func_num_args()) { |
27 | 29 | $args = func_get_args(); |
@@ -51,4 +53,3 @@ function plugin_random_action() | ||
51 | 53 | |
52 | 54 | return array('body'=>'','msg'=>''); |
53 | 55 | } |
54 | - |
@@ -107,9 +107,10 @@ EOD; | ||
107 | 107 | |
108 | 108 | function plugin_ref_body($args) |
109 | 109 | { |
110 | - global $script, $vars; | |
110 | + global $vars; | |
111 | 111 | global $WikiName, $BracketName; // compat |
112 | 112 | |
113 | + $script = get_script_uri(); | |
113 | 114 | // 戻り値 |
114 | 115 | $params = array( |
115 | 116 | 'left' => FALSE, // 左寄せ |
@@ -92,8 +92,9 @@ function plugin_rename_err($err, $page = '') | ||
92 | 92 | //第一段階:ページ名または正規表現の入力 |
93 | 93 | function plugin_rename_phase1($err = '', $page = '') |
94 | 94 | { |
95 | - global $script, $_rename_messages; | |
95 | + global $_rename_messages; | |
96 | 96 | |
97 | + $script = get_script_uri(); | |
97 | 98 | $msg = plugin_rename_err($err, $page); |
98 | 99 | $refer = plugin_rename_getvar('refer'); |
99 | 100 | $method = plugin_rename_getvar('method'); |
@@ -134,8 +135,9 @@ EOD; | ||
134 | 135 | //第二段階:新しい名前の入力 |
135 | 136 | function plugin_rename_phase2($err = '') |
136 | 137 | { |
137 | - global $script, $_rename_messages; | |
138 | + global $_rename_messages; | |
138 | 139 | |
140 | + $script = get_script_uri(); | |
139 | 141 | $msg = plugin_rename_err($err); |
140 | 142 | $page = plugin_rename_getvar('page'); |
141 | 143 | $refer = plugin_rename_getvar('refer'); |
@@ -213,8 +215,9 @@ function plugin_rename_regex($arr_from, $arr_to) | ||
213 | 215 | |
214 | 216 | function plugin_rename_phase3($pages) |
215 | 217 | { |
216 | - global $script, $_rename_messages; | |
218 | + global $_rename_messages; | |
217 | 219 | |
220 | + $script = get_script_uri(); | |
218 | 221 | $msg = $input = ''; |
219 | 222 | $files = plugin_rename_get_files($pages); |
220 | 223 |
@@ -1,6 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: search.inc.php,v 1.14 2011/01/25 15:01:01 henoheno Exp $ | |
3 | +// search.inc.php | |
4 | +// Copyright 2003-2017 PukiWiki Development Team | |
5 | +// License: GPL v2 or (at your option) any later version | |
4 | 6 | // |
5 | 7 | // Search plugin |
6 | 8 |
@@ -62,9 +64,10 @@ function plugin_search_action() | ||
62 | 64 | |
63 | 65 | function plugin_search_search_form($s_word = '', $type = '', $bases = array()) |
64 | 66 | { |
65 | - global $script, $_btn_and, $_btn_or, $_btn_search; | |
67 | + global $_btn_and, $_btn_or, $_btn_search; | |
66 | 68 | global $_search_pages, $_search_all; |
67 | 69 | |
70 | + $script = get_script_uri(); | |
68 | 71 | $and_check = $or_check = ''; |
69 | 72 | if ($type == 'OR') { |
70 | 73 | $or_check = ' checked="checked"'; |
@@ -113,4 +116,3 @@ $base_option | ||
113 | 116 | </form> |
114 | 117 | EOD; |
115 | 118 | } |
116 | -?> |
@@ -12,12 +12,13 @@ define('MAX_LEN', 60); | ||
12 | 12 | |
13 | 13 | function plugin_template_action() |
14 | 14 | { |
15 | - global $script, $vars; | |
15 | + global $vars; | |
16 | 16 | global $_title_edit; |
17 | 17 | global $_msg_template_start, $_msg_template_end, $_msg_template_page, $_msg_template_refer; |
18 | 18 | global $_btn_template_create, $_title_template; |
19 | 19 | global $_err_template_already, $_err_template_invalid, $_msg_template_force; |
20 | 20 | |
21 | + $script = get_script_uri(); | |
21 | 22 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
22 | 23 | if (! isset($vars['refer']) || ! is_page($vars['refer'])) |
23 | 24 | return FALSE; |
@@ -17,8 +17,9 @@ define('TRACKER_LIST_SHOW_ERROR_PAGE',TRUE); | ||
17 | 17 | |
18 | 18 | function plugin_tracker_convert() |
19 | 19 | { |
20 | - global $script,$vars; | |
20 | + global $vars; | |
21 | 21 | |
22 | + $script = get_script_uri(); | |
22 | 23 | if (PKWK_READONLY) return ''; // Show nothing |
23 | 24 | |
24 | 25 | $base = $refer = $vars['page']; |
@@ -656,7 +657,7 @@ function plugin_tracker_list_convert() | ||
656 | 657 | } |
657 | 658 | function plugin_tracker_list_action() |
658 | 659 | { |
659 | - global $script,$vars,$_tracker_messages; | |
660 | + global $vars,$_tracker_messages; | |
660 | 661 | |
661 | 662 | $page = $refer = $vars['refer']; |
662 | 663 | $s_page = make_pagelink($page); |
@@ -881,8 +882,7 @@ class Tracker_list | ||
881 | 882 | } |
882 | 883 | function replace_title($arr) |
883 | 884 | { |
884 | - global $script; | |
885 | - | |
885 | + $script = get_script_uri(); | |
886 | 886 | $field = $sort = $arr[1]; |
887 | 887 | if ($sort == '_name' or $sort == '_page') |
888 | 888 | { |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // $Id: unfreeze.inc.php,v 1.14 2011/01/25 15:01:01 henoheno Exp $ |
4 | -// Copyright (C) 2003-2004, 2007 PukiWiki Developers Team | |
4 | +// Copyright 2003-2017 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Unfreeze(Unlock) plugin |
@@ -11,10 +11,11 @@ define('PLUGIN_UNFREEZE_EDIT', TRUE); | ||
11 | 11 | |
12 | 12 | function plugin_unfreeze_action() |
13 | 13 | { |
14 | - global $script, $vars, $function_freeze; | |
14 | + global $vars, $function_freeze; | |
15 | 15 | global $_title_isunfreezed, $_title_unfreezed, $_title_unfreeze; |
16 | 16 | global $_msg_invalidpass, $_msg_unfreezing, $_btn_unfreeze; |
17 | 17 | |
18 | + $script = get_script_uri(); | |
18 | 19 | $page = isset($vars['page']) ? $vars['page'] : ''; |
19 | 20 | if (! $function_freeze || ! is_page($page)) |
20 | 21 | return array('msg' => '', 'body' => ''); |
@@ -70,4 +71,3 @@ EOD; | ||
70 | 71 | |
71 | 72 | return array('msg'=>$msg, 'body'=>$body); |
72 | 73 | } |
73 | -?> |
@@ -1,8 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // update_entities.inc.php |
4 | -// Copyright | |
5 | -// 2003-2007 PukiWiki Development Team | |
4 | +// Copyright 2017 PukiWiki Development Team | |
6 | 5 | // License: GPL v2 or (at your option) any later version |
7 | 6 | // |
8 | 7 | // Update entities plugin - Update XHTML entities from DTD |
@@ -39,9 +38,10 @@ PHPの持つテーブルおよびW3CのDTDをスキャンして、キャッシ | ||
39 | 38 | |
40 | 39 | function plugin_update_entities_action() |
41 | 40 | { |
42 | - global $script, $vars; | |
41 | + global $vars; | |
43 | 42 | global $_entities_messages; |
44 | 43 | |
44 | + $script = get_script_uri(); | |
45 | 45 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits this'); |
46 | 46 | |
47 | 47 | $msg = $body = ''; |
@@ -1,17 +1,18 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: vote.inc.php,v 1.27 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) 2002-2005, 2007 PukiWiki Developers Team | |
3 | +// vote.inc.php | |
4 | +// Copyright 2002-2017 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Vote box plugin |
8 | 8 | |
9 | 9 | function plugin_vote_action() |
10 | 10 | { |
11 | - global $vars, $script, $cols,$rows; | |
11 | + global $vars, $cols,$rows; | |
12 | 12 | global $_title_collided, $_msg_collided, $_title_updated; |
13 | 13 | global $_vote_plugin_votes; |
14 | 14 | |
15 | + $script = get_script_uri(); | |
15 | 16 | if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing'); |
16 | 17 | |
17 | 18 | $postdata_old = get_source($vars['refer']); |
@@ -76,7 +77,7 @@ EOD; | ||
76 | 77 | |
77 | 78 | function plugin_vote_convert() |
78 | 79 | { |
79 | - global $script, $vars, $digest; | |
80 | + global $vars, $digest; | |
80 | 81 | global $_vote_plugin_choice, $_vote_plugin_votes; |
81 | 82 | static $number = array(); |
82 | 83 |
@@ -92,7 +93,7 @@ function plugin_vote_convert() | ||
92 | 93 | $_script = ''; |
93 | 94 | $_submit = 'hidden'; |
94 | 95 | } else { |
95 | - $_script = $script; | |
96 | + $_script = get_script_uri(); | |
96 | 97 | $_submit = 'submit'; |
97 | 98 | } |
98 | 99 |
@@ -149,4 +150,3 @@ EOD; | ||
149 | 150 | |
150 | 151 | return $body; |
151 | 152 | } |
152 | -?> |