• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revisión722b904ea18ee3b1fe30824dc1c6490214b41d63 (tree)
Tiempo2007-07-28 22:50:09
Autorhenoheno <henoheno>
Commiterhenoheno

Log Message

BugTrack2/255: Keep it $cantedit

Cambiar Resumen

Diferencia incremental

--- a/lib/func.php
+++ b/lib/func.php
@@ -1,6 +1,6 @@
11 <?php
22 // 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 $
44 // Copyright (C)
55 // 2002-2007 PukiWiki Developers Team
66 // 2001-2002 Originally written by yu-ji
@@ -51,16 +51,30 @@ function is_page($page, $clearcache = FALSE)
5151 return file_exists(get_filename($page));
5252 }
5353
54-function is_editable($page)
54+// Handling $cantedit
55+function is_cantedit($page)
5556 {
5657 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+{
5771 static $is_editable = array();
5872
5973 if (! isset($is_editable[$page])) {
6074 $is_editable[$page] = (
6175 is_pagename($page) &&
6276 ! is_freeze($page) &&
63- ! in_array($page, $cantedit)
77+ ! is_cantedit($page)
6478 );
6579 }
6680
--- a/lib/html.php
+++ b/lib/html.php
@@ -1,6 +1,6 @@
11 <?php
22 // 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 $
44 // Copyright (C)
55 // 2002-2007 PukiWiki Developers Team
66 // 2001-2002 Originally written by yu-ji
@@ -12,7 +12,7 @@
1212 function catbody($title, $page, $body)
1313 {
1414 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;
1616 global $search_word_color, $_msg_word, $foot_explain, $note_hr, $head_tags;
1717 global $javascript, $nofollow;
1818 global $_LANG, $_LINK, $_IMAGE;
@@ -82,7 +82,7 @@ function catbody($title, $page, $body)
8282 $link_rename = & $_LINK['rename'];
8383
8484 // 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));
8686 $is_read = (arg_check('read') && is_page($_page));
8787 $is_freeze = is_freeze($_page);
8888
@@ -157,7 +157,7 @@ function edit_form($page, $postdata, $digest = FALSE, $b_template = TRUE)
157157 {
158158 global $script, $vars, $rows, $cols, $hr, $function_freeze;
159159 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;
161161 global $notimeupdate;
162162
163163 // Newly generate $digest or not
@@ -181,7 +181,7 @@ function edit_form($page, $postdata, $digest = FALSE, $b_template = TRUE)
181181 if($load_template_func && $b_template) {
182182 $pages = array();
183183 foreach(get_existpages() as $_page) {
184- if ($_page == $whatsnew || check_non_list($_page))
184+ if (is_cantedit($_page) || check_non_list($_page))
185185 continue;
186186 $s_page = htmlspecialchars($_page);
187187 $pages[$_page] = ' <option value="' . $s_page . '">' .
--- a/lib/link.php
+++ b/lib/link.php
@@ -1,6 +1,6 @@
11 <?php
22 // 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 $
44 // Copyright (C) 2003-2006 PukiWiki Developers Team
55 // License: GPL v2 or (at your option) any later version
66 //
@@ -135,8 +135,6 @@ function links_update($page)
135135 // Init link cache (Called from link plugin)
136136 function links_init()
137137 {
138- global $whatsnew;
139-
140138 if (PKWK_READONLY) return; // Do nothing
141139
142140 if (ini_get('safe_mode') == '0') set_time_limit(0);
@@ -149,7 +147,7 @@ function links_init()
149147
150148 $ref = array(); // 参照元
151149 foreach (get_existpages() as $page) {
152- if ($page == $whatsnew) continue;
150+ if (is_cantedit($page)) continue;
153151
154152 $rel = array(); // 参照先
155153 $links = links_get_objects($page);