Revisión | 722b904ea18ee3b1fe30824dc1c6490214b41d63 (tree) |
---|---|
Tiempo | 2007-07-28 22:50:09 |
Autor | henoheno <henoheno> |
Commiter | henoheno |
BugTrack2/255: Keep it $cantedit
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: func.php,v 1.91 2007/06/24 13:59:46 henoheno Exp $ | |
3 | +// $Id: func.php,v 1.92 2007/07/28 13:50:09 henoheno Exp $ | |
4 | 4 | // Copyright (C) |
5 | 5 | // 2002-2007 PukiWiki Developers Team |
6 | 6 | // 2001-2002 Originally written by yu-ji |
@@ -51,16 +51,30 @@ function is_page($page, $clearcache = FALSE) | ||
51 | 51 | return file_exists(get_filename($page)); |
52 | 52 | } |
53 | 53 | |
54 | -function is_editable($page) | |
54 | +// Handling $cantedit | |
55 | +function is_cantedit($page) | |
55 | 56 | { |
56 | 57 | global $cantedit; |
58 | + static $is_cantedit; | |
59 | + | |
60 | + if (! isset($is_cantedit)) { | |
61 | + foreach($cantedit as $key) { | |
62 | + $is_cantedit[$key] = TRUE; | |
63 | + } | |
64 | + } | |
65 | + | |
66 | + return isset($is_cantedit[$page]); | |
67 | +} | |
68 | + | |
69 | +function is_editable($page) | |
70 | +{ | |
57 | 71 | static $is_editable = array(); |
58 | 72 | |
59 | 73 | if (! isset($is_editable[$page])) { |
60 | 74 | $is_editable[$page] = ( |
61 | 75 | is_pagename($page) && |
62 | 76 | ! is_freeze($page) && |
63 | - ! in_array($page, $cantedit) | |
77 | + ! is_cantedit($page) | |
64 | 78 | ); |
65 | 79 | } |
66 | 80 |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: html.php,v 1.63 2007/06/24 13:59:46 henoheno Exp $ | |
3 | +// $Id: html.php,v 1.64 2007/07/28 13:50:09 henoheno Exp $ | |
4 | 4 | // Copyright (C) |
5 | 5 | // 2002-2007 PukiWiki Developers Team |
6 | 6 | // 2001-2002 Originally written by yu-ji |
@@ -12,7 +12,7 @@ | ||
12 | 12 | function catbody($title, $page, $body) |
13 | 13 | { |
14 | 14 | global $script, $vars, $arg, $defaultpage, $whatsnew, $help_page, $hr; |
15 | - global $attach_link, $related_link, $cantedit, $function_freeze; | |
15 | + global $attach_link, $related_link, $function_freeze; | |
16 | 16 | global $search_word_color, $_msg_word, $foot_explain, $note_hr, $head_tags; |
17 | 17 | global $javascript, $nofollow; |
18 | 18 | global $_LANG, $_LINK, $_IMAGE; |
@@ -82,7 +82,7 @@ function catbody($title, $page, $body) | ||
82 | 82 | $link_rename = & $_LINK['rename']; |
83 | 83 | |
84 | 84 | // Init flags |
85 | - $is_page = (is_pagename($_page) && ! arg_check('backup') && $_page != $whatsnew); | |
85 | + $is_page = (is_pagename($_page) && ! arg_check('backup') && ! is_cantedit($_page)); | |
86 | 86 | $is_read = (arg_check('read') && is_page($_page)); |
87 | 87 | $is_freeze = is_freeze($_page); |
88 | 88 |
@@ -157,7 +157,7 @@ function edit_form($page, $postdata, $digest = FALSE, $b_template = TRUE) | ||
157 | 157 | { |
158 | 158 | global $script, $vars, $rows, $cols, $hr, $function_freeze; |
159 | 159 | global $_btn_preview, $_btn_repreview, $_btn_update, $_btn_cancel, $_msg_help; |
160 | - global $whatsnew, $_btn_template, $_btn_load, $load_template_func; | |
160 | + global $_btn_template, $_btn_load, $load_template_func; | |
161 | 161 | global $notimeupdate; |
162 | 162 | |
163 | 163 | // Newly generate $digest or not |
@@ -181,7 +181,7 @@ function edit_form($page, $postdata, $digest = FALSE, $b_template = TRUE) | ||
181 | 181 | if($load_template_func && $b_template) { |
182 | 182 | $pages = array(); |
183 | 183 | foreach(get_existpages() as $_page) { |
184 | - if ($_page == $whatsnew || check_non_list($_page)) | |
184 | + if (is_cantedit($_page) || check_non_list($_page)) | |
185 | 185 | continue; |
186 | 186 | $s_page = htmlspecialchars($_page); |
187 | 187 | $pages[$_page] = ' <option value="' . $s_page . '">' . |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: link.php,v 1.14 2006/09/18 05:23:12 henoheno Exp $ | |
3 | +// $Id: link.php,v 1.15 2007/07/28 13:50:09 henoheno Exp $ | |
4 | 4 | // Copyright (C) 2003-2006 PukiWiki Developers Team |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
@@ -135,8 +135,6 @@ function links_update($page) | ||
135 | 135 | // Init link cache (Called from link plugin) |
136 | 136 | function links_init() |
137 | 137 | { |
138 | - global $whatsnew; | |
139 | - | |
140 | 138 | if (PKWK_READONLY) return; // Do nothing |
141 | 139 | |
142 | 140 | if (ini_get('safe_mode') == '0') set_time_limit(0); |
@@ -149,7 +147,7 @@ function links_init() | ||
149 | 147 | |
150 | 148 | $ref = array(); // 参照元 |
151 | 149 | foreach (get_existpages() as $page) { |
152 | - if ($page == $whatsnew) continue; | |
150 | + if (is_cantedit($page)) continue; | |
153 | 151 | |
154 | 152 | $rel = array(); // 参照先 |
155 | 153 | $links = links_get_objects($page); |