Révision | 57ea151442279a5bfded4da89d2246d496fc5186 (tree) |
---|---|
l'heure | 2014-11-30 11:20:42 |
Auteur | henoheno <henoheno> |
Commiter | umorigu |
BugTrack2/236: If you compare two numerical strings, they are compared as integers
@@ -415,7 +415,7 @@ function put_lastmodified() | ||
415 | 415 | // Check ALL filetime |
416 | 416 | $recent_pages = array(); |
417 | 417 | foreach($pages as $page) |
418 | - if ($page != $whatsnew && ! check_non_list($page)) | |
418 | + if ($page !== $whatsnew && ! check_non_list($page)) | |
419 | 419 | $recent_pages[$page] = get_filetime($page); |
420 | 420 | |
421 | 421 | // Sort decending order of last-modification date |
@@ -713,7 +713,7 @@ function links_get_related($page) | ||
713 | 713 | if (isset($links[$page])) return $links[$page]; |
714 | 714 | |
715 | 715 | // If possible, merge related pages generated by make_link() |
716 | - $links[$page] = ($page == $vars['page']) ? $related : array(); | |
716 | + $links[$page] = ($page === $vars['page']) ? $related : array(); | |
717 | 717 | |
718 | 718 | // Get repated pages from DB |
719 | 719 | $links[$page] += links_get_related_db($vars['page']); |
@@ -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')) { // 行儀が悪い |
@@ -109,7 +109,7 @@ function links_update($page) | ||
109 | 109 | $search_non_list = 1; |
110 | 110 | $pages = do_search($page, 'AND', TRUE); |
111 | 111 | foreach ($pages as $_page) { |
112 | - if ($_page != $page) | |
112 | + if ($_page !== $page) | |
113 | 113 | links_update($_page); |
114 | 114 | } |
115 | 115 | } |
@@ -193,7 +193,7 @@ function links_add($page, $add, $rel_auto) | ||
193 | 193 | foreach (file($ref_file) as $line) { |
194 | 194 | list($ref_page, $ref_auto) = explode("\t", rtrim($line)); |
195 | 195 | if (! $ref_auto) $all_auto = FALSE; |
196 | - if ($ref_page != $page) $ref .= $line; | |
196 | + if ($ref_page !== $page) $ref .= $line; | |
197 | 197 | } |
198 | 198 | unlink($ref_file); |
199 | 199 | } |
@@ -220,7 +220,7 @@ function links_delete($page, $del) | ||
220 | 220 | $ref = ''; |
221 | 221 | foreach (file($ref_file) as $line) { |
222 | 222 | list($ref_page, $ref_auto) = explode("\t", rtrim($line)); |
223 | - if ($ref_page != $page) { | |
223 | + if ($ref_page !== $page) { | |
224 | 224 | if (! $ref_auto) $all_auto = FALSE; |
225 | 225 | $ref .= $line; |
226 | 226 | } |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // $Id: make_link.php,v 1.38 2011/01/25 15:01:01 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 | // |
@@ -716,7 +716,7 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin | ||
716 | 716 | $r_page = rawurlencode($page); |
717 | 717 | $r_refer = ($refer == '') ? '' : '&refer=' . rawurlencode($refer); |
718 | 718 | |
719 | - if (! isset($related[$page]) && $page != $vars['page'] && is_page($page)) | |
719 | + if (! isset($related[$page]) && $page !== $vars['page'] && is_page($page)) | |
720 | 720 | $related[$page] = get_filetime($page); |
721 | 721 | |
722 | 722 | if ($isautolink || is_page($page)) { |
@@ -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)){ |
@@ -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 { |
@@ -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 ' . htmlsc($page) . ' -->'; |
52 | 52 | } else { |
53 | 53 | // Cut fixed anchors |
@@ -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 | } |
@@ -81,7 +81,7 @@ function plugin_popular_convert() | ||
81 | 81 | $page = substr($page, 1); |
82 | 82 | |
83 | 83 | $s_page = htmlsc($page); |
84 | - if ($page == $vars['page']) { | |
84 | + if ($page === $vars['page']) { | |
85 | 85 | // No need to link itself, notifies where you just read |
86 | 86 | $pg_passage = get_pg_passage($page,FALSE); |
87 | 87 | $items .= ' <li><span title="' . $s_page . ' ' . $pg_passage . '">' . |
@@ -39,7 +39,7 @@ function plugin_rename_action() | ||
39 | 39 | $page = plugin_rename_getvar('page'); |
40 | 40 | $refer = plugin_rename_getvar('refer'); |
41 | 41 | |
42 | - if ($refer === '') { | |
42 | + if ($refer == '') { | |
43 | 43 | return plugin_rename_phase1(); |
44 | 44 | |
45 | 45 | } else if (! is_page($refer)) { |
@@ -48,7 +48,7 @@ function plugin_rename_action() | ||
48 | 48 | } else if ($refer === $whatsnew) { |
49 | 49 | return plugin_rename_phase1('norename', $refer); |
50 | 50 | |
51 | - } else if ($page === '' || $page === $refer) { | |
51 | + } else if ($page == '' || $page === $refer) { | |
52 | 52 | return plugin_rename_phase2(); |
53 | 53 | |
54 | 54 | } else if (! is_pagename($page)) { |