OSDN Git Service
(root)
/
pukiwiki
/
pukiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bc566bf
)
Fix. Dont use get_source() to check only the 1st line of the page. Cleanup $non_list
author
henoheno
<henoheno>
Mon, 10 Jan 2005 03:18:58 +0000
(12:18 +0900)
committer
henoheno
<henoheno>
Mon, 10 Jan 2005 03:18:58 +0000
(12:18 +0900)
lib/func.php
patch
|
blob
|
history
diff --git
a/lib/func.php
b/lib/func.php
index
64e7eb0
..
30fdd23
100644
(file)
--- a/
lib/func.php
+++ b/
lib/func.php
@@
-1,6
+1,6
@@
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: func.php,v 1.2
3 2005/01/02 06:38:1
8 henoheno Exp $
+// $Id: func.php,v 1.2
4 2005/01/10 03:18:5
8 henoheno Exp $
//
// General functions
//
// General functions
@@
-63,7
+63,6
@@
function is_editable($page)
return $is_editable[$page];
}
return $is_editable[$page];
}
-// FIXME: Dont use get_source() to check the 1st line of the page!
function is_freeze($page, $clearcache = FALSE)
{
global $function_freeze;
function is_freeze($page, $clearcache = FALSE)
{
global $function_freeze;
@@
-76,8
+75,11
@@
function is_freeze($page, $clearcache = FALSE)
$is_freeze[$page] = FALSE;
return FALSE;
} else {
$is_freeze[$page] = FALSE;
return FALSE;
} else {
- list($lines) = array_pad(get_source($page), 1, '');
- $is_freeze[$page] = (rtrim($lines) == '#freeze');
+ $fp = fopen(get_filename($page), 'rb');
+ $buffer = fgets($fp, 8);
+ fclose($fp);
+
+ $is_freeze[$page] = ($buffer != FALSE && rtrim($buffer) == '#freeze');
return $is_freeze[$page];
}
}
return $is_freeze[$page];
}
}
@@
-181,8
+183,9
@@
function do_search($word, $type = 'AND', $non_format = FALSE)
$_pages = get_existpages();
$pages = array();
$_pages = get_existpages();
$pages = array();
+ $non_list_pattern = '/' . $non_list . '/';
foreach ($_pages as $page) {
foreach ($_pages as $page) {
- if ($page == $whatsnew || (! $search_non_list && preg_match(
"/$non_list/"
, $page)))
+ if ($page == $whatsnew || (! $search_non_list && preg_match(
$non_list_pattern
, $page)))
continue;
// ¸¡º÷Âоݥڡ¼¥¸¤ÎÀ©¸Â¤ò¤«¤±¤ë¤«¤É¤¦¤« (¥Ú¡¼¥¸Ì¾¤ÏÀ©¸Â³°)
continue;
// ¸¡º÷Âоݥڡ¼¥¸¤ÎÀ©¸Â¤ò¤«¤±¤ë¤«¤É¤¦¤« (¥Ú¡¼¥¸Ì¾¤ÏÀ©¸Â³°)