修訂 | 2a9257ba23e5eabd369ea57f22835a31fb7c2125 (tree) |
---|---|
時間 | 2007-10-06 22:20:59 |
作者 | henoheno <henoheno> |
Commiter | henoheno |
BugTrack2/236: If you compare two numerical strings, they are compared as integers
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: file.php,v 1.87 2007/09/23 04:23:40 henoheno Exp $ | |
3 | +// $Id: file.php,v 1.88 2007/10/06 13:20:48 henoheno Exp $ | |
4 | 4 | // Copyright (C) |
5 | 5 | // 2002-2007 PukiWiki Developers Team |
6 | 6 | // 2001-2002 Originally written by yu-ji |
@@ -103,7 +103,7 @@ function page_write($page, $postdata, $notimestamp = FALSE) | ||
103 | 103 | links_update($page); |
104 | 104 | |
105 | 105 | // Update autoalias.dat (AutoAliasName) |
106 | - if ($autoalias && $page == $aliaspage) { | |
106 | + if ($autoalias && $page === $aliaspage) { | |
107 | 107 | $aliases = get_autoaliases(); |
108 | 108 | if (empty($aliases)) { |
109 | 109 | // Remove |
@@ -434,7 +434,7 @@ function put_lastmodified() | ||
434 | 434 | // Check ALL filetime |
435 | 435 | $recent_pages = array(); |
436 | 436 | foreach($pages as $page) |
437 | - if ($page != $whatsnew && ! check_non_list($page)) | |
437 | + if ($page !== $whatsnew && ! check_non_list($page)) | |
438 | 438 | $recent_pages[$page] = get_filetime($page); |
439 | 439 | |
440 | 440 | // Sort decending order of last-modification date |
@@ -735,7 +735,7 @@ function links_get_related($page) | ||
735 | 735 | if (isset($links[$page])) return $links[$page]; |
736 | 736 | |
737 | 737 | // If possible, merge related pages generated by make_link() |
738 | - $links[$page] = ($page == $vars['page']) ? $related : array(); | |
738 | + $links[$page] = ($page === $vars['page']) ? $related : array(); | |
739 | 739 | |
740 | 740 | // Get repated pages from DB |
741 | 741 | $links[$page] += links_get_related_db($vars['page']); |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: link.php,v 1.16 2007/07/28 17:13:30 henoheno Exp $ | |
3 | +// $Id: link.php,v 1.17 2007/10/06 13:20:48 henoheno Exp $ | |
4 | 4 | // Copyright (C) 2003-2006, 2007 PukiWiki Developers Team |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
@@ -67,7 +67,7 @@ function links_update($page) | ||
67 | 67 | $links = links_get_objects($page, TRUE); |
68 | 68 | foreach ($links as $_obj) { |
69 | 69 | if (! isset($_obj->type) || $_obj->type != 'pagename' || |
70 | - $_obj->name == $page || $_obj->name == '') | |
70 | + $_obj->name === $page || $_obj->name == '') | |
71 | 71 | continue; |
72 | 72 | |
73 | 73 | if (is_a($_obj, 'Link_autolink')) { // 行儀が悪い |
@@ -114,7 +114,7 @@ function links_update($page) | ||
114 | 114 | $search_non_list = 1; |
115 | 115 | $pages = do_search($page, 'AND', TRUE); |
116 | 116 | foreach ($pages as $_page) { |
117 | - if ($_page != $page) | |
117 | + if ($_page !== $page) | |
118 | 118 | links_update($_page); |
119 | 119 | } |
120 | 120 | } |
@@ -203,7 +203,7 @@ function links_add($page, $add, $rel_auto) | ||
203 | 203 | foreach (file($ref_file) as $line) { |
204 | 204 | list($ref_page, $ref_auto) = explode("\t", rtrim($line)); |
205 | 205 | if (! $ref_auto) $all_auto = FALSE; |
206 | - if ($ref_page != $page) $ref .= $line; | |
206 | + if ($ref_page !== $page) $ref .= $line; | |
207 | 207 | } |
208 | 208 | unlink($ref_file); |
209 | 209 | } |
@@ -230,7 +230,7 @@ function links_delete($page, $del) | ||
230 | 230 | $ref = ''; |
231 | 231 | foreach (file($ref_file) as $line) { |
232 | 232 | list($ref_page, $ref_auto) = explode("\t", rtrim($line)); |
233 | - if ($ref_page != $page) { | |
233 | + if ($ref_page !== $page) { | |
234 | 234 | if (! $ref_auto) $all_auto = FALSE; |
235 | 235 | $ref .= $line; |
236 | 236 | } |
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: make_link.php,v 1.35 2006/09/30 02:10:50 henoheno Exp $ | |
3 | +// $Id: make_link.php,v 1.36 2007/10/06 13:20:48 henoheno Exp $ | |
4 | 4 | // Copyright (C) |
5 | -// 2003-2005 PukiWiki Developers Team | |
5 | +// 2003-2005, 2007 PukiWiki Developers Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -784,7 +784,7 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin | ||
784 | 784 | $r_page = rawurlencode($page); |
785 | 785 | $r_refer = ($refer == '') ? '' : '&refer=' . rawurlencode($refer); |
786 | 786 | |
787 | - if (! isset($related[$page]) && $page != $vars['page'] && is_page($page)) | |
787 | + if (! isset($related[$page]) && $page !== $vars['page'] && is_page($page)) | |
788 | 788 | $related[$page] = get_filetime($page); |
789 | 789 | |
790 | 790 | if ($isautolink || is_page($page)) { |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: edit.inc.php,v 1.45 2007/08/19 14:20:58 henoheno Exp $ | |
3 | +// $Id: edit.inc.php,v 1.46 2007/10/06 13:20:59 henoheno Exp $ | |
4 | 4 | // Copyright (C) 2001-2007 PukiWiki Developers Team |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
@@ -93,7 +93,7 @@ function plugin_edit_inline() | ||
93 | 93 | $s_label = strip_htmltag(array_pop($args), FALSE); |
94 | 94 | |
95 | 95 | $page = array_shift($args); |
96 | - if ($page == NULL) $page = ''; | |
96 | + if ($page === NULL) $page = ''; | |
97 | 97 | $_noicon = $_nolabel = FALSE; |
98 | 98 | foreach($args as $arg){ |
99 | 99 | switch(strtolower($arg)){ |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: include.inc.php,v 1.21 2004/12/30 13:26:43 henoheno Exp $ | |
3 | +// $Id: include.inc.php,v 1.22 2007/10/06 13:20:59 henoheno Exp $ | |
4 | 4 | // |
5 | 5 | // Include-once plugin |
6 | 6 |
@@ -108,7 +108,7 @@ function plugin_include_convert() | ||
108 | 108 | if ($with_title) { |
109 | 109 | $link = '<a href="' . $script . '?cmd=edit&page=' . $r_page . |
110 | 110 | '">' . $s_page . '</a>'; |
111 | - if ($page == $menubar) { | |
111 | + if ($page === $menubar) { | |
112 | 112 | $body = '<span align="center"><h5 class="side_label">' . |
113 | 113 | $link . '</h5></span><small>' . $body . '</small>'; |
114 | 114 | } else { |
@@ -2,7 +2,7 @@ | ||
2 | 2 | ///////////////////////////////////////////////// |
3 | 3 | // PukiWiki - Yet another WikiWikiWeb clone. |
4 | 4 | // |
5 | -// $Id: menu.inc.php,v 1.8 2004/11/27 12:23:02 henoheno Exp $ | |
5 | +// $Id: menu.inc.php,v 1.9 2007/10/06 13:20:59 henoheno Exp $ | |
6 | 6 | // |
7 | 7 | |
8 | 8 | // サブメニューを使用する |
@@ -47,7 +47,7 @@ function plugin_menu_convert() | ||
47 | 47 | |
48 | 48 | if (! is_page($page)) { |
49 | 49 | return ''; |
50 | - } else if ($vars['page'] == $page) { | |
50 | + } else if ($vars['page'] === $page) { | |
51 | 51 | return '<!-- #menu(): You already view ' . htmlspecialchars($page) . ' -->'; |
52 | 52 | } else { |
53 | 53 | // Cut fixed anchors |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: navi.inc.php,v 1.22 2005/04/02 06:33:39 henoheno Exp $ | |
3 | +// $Id: navi.inc.php,v 1.23 2007/10/06 13:20:59 henoheno Exp $ | |
4 | 4 | // |
5 | 5 | // Navi plugin: Show DocBook-like navigation bar and contents |
6 | 6 |
@@ -100,7 +100,7 @@ function plugin_navi_convert() | ||
100 | 100 | |
101 | 101 | $prev = $home; |
102 | 102 | foreach ($pages as $page) { |
103 | - if ($page == $current) break; | |
103 | + if ($page === $current) break; | |
104 | 104 | $prev = $page; |
105 | 105 | } |
106 | 106 | $next = current($pages); |
@@ -154,7 +154,7 @@ function plugin_navi_convert() | ||
154 | 154 | } else { |
155 | 155 | $ret .= '<ul>'; |
156 | 156 | foreach ($pages as $page) |
157 | - if ($page != $home) | |
157 | + if ($page !== $home) | |
158 | 158 | $ret .= ' <li>' . make_pagelink($page) . '</li>'; |
159 | 159 | $ret .= '</ul>'; |
160 | 160 | } |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: popular.inc.php,v 1.18 2007/07/28 17:12:42 henoheno Exp $ | |
3 | +// $Id: popular.inc.php,v 1.19 2007/10/06 13:20:59 henoheno Exp $ | |
4 | 4 | // Copyright (C) |
5 | 5 | // 2003-2005, 2007 PukiWiki Developers Team |
6 | 6 | // 2002 Kazunori Mizushima <kazunori@uc.netyou.jp> |
@@ -78,7 +78,7 @@ function plugin_popular_convert() | ||
78 | 78 | $page = substr($page, 1); |
79 | 79 | |
80 | 80 | $s_page = htmlspecialchars($page); |
81 | - if ($page == $vars['page']) { | |
81 | + if ($page === $vars['page']) { | |
82 | 82 | // No need to link itself, notifies where you just read |
83 | 83 | $pg_passage = get_pg_passage($page,FALSE); |
84 | 84 | $items .= ' <li><span title="' . $s_page . ' ' . $pg_passage . '">' . |
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: rename.inc.php,v 1.35 2007/07/28 14:02:48 henoheno Exp $ | |
3 | +// $Id: rename.inc.php,v 1.36 2007/10/06 13:20:59 henoheno Exp $ | |
4 | 4 | // Copyright (C) 2002-2005, 2007 PukiWiki Developers Team |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
@@ -40,7 +40,7 @@ function plugin_rename_action() | ||
40 | 40 | $page = plugin_rename_getvar('page'); |
41 | 41 | $refer = plugin_rename_getvar('refer'); |
42 | 42 | |
43 | - if ($refer === '') { | |
43 | + if ($refer == '') { | |
44 | 44 | return plugin_rename_phase1(); |
45 | 45 | |
46 | 46 | } else if (! is_page($refer)) { |
@@ -49,7 +49,7 @@ function plugin_rename_action() | ||
49 | 49 | } else if (is_cantedit($refer)) { |
50 | 50 | return plugin_rename_phase1('norename', $refer); |
51 | 51 | |
52 | - } else if ($page === '' || $page === $refer) { | |
52 | + } else if ($page == '' || $page === $refer) { | |
53 | 53 | return plugin_rename_phase2(); |
54 | 54 | |
55 | 55 | } else if (! is_pagename($page)) { |