• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

Commit MetaInfo

Revision57ea151442279a5bfded4da89d2246d496fc5186 (tree)
Time2014-11-30 11:20:42
Authorhenoheno <henoheno>
Commiterumorigu

Log Message

BugTrack2/236: If you compare two numerical strings, they are compared as integers

Change Summary

Incremental Difference

--- a/lib/file.php
+++ b/lib/file.php
@@ -415,7 +415,7 @@ function put_lastmodified()
415415 // Check ALL filetime
416416 $recent_pages = array();
417417 foreach($pages as $page)
418- if ($page != $whatsnew && ! check_non_list($page))
418+ if ($page !== $whatsnew && ! check_non_list($page))
419419 $recent_pages[$page] = get_filetime($page);
420420
421421 // Sort decending order of last-modification date
@@ -713,7 +713,7 @@ function links_get_related($page)
713713 if (isset($links[$page])) return $links[$page];
714714
715715 // 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();
717717
718718 // Get repated pages from DB
719719 $links[$page] += links_get_related_db($vars['page']);
--- a/lib/link.php
+++ b/lib/link.php
@@ -67,7 +67,7 @@ function links_update($page)
6767 $links = links_get_objects($page, TRUE);
6868 foreach ($links as $_obj) {
6969 if (! isset($_obj->type) || $_obj->type != 'pagename' ||
70- $_obj->name == $page || $_obj->name == '')
70+ $_obj->name === $page || $_obj->name == '')
7171 continue;
7272
7373 if (is_a($_obj, 'Link_autolink')) { // 行儀が悪い
@@ -109,7 +109,7 @@ function links_update($page)
109109 $search_non_list = 1;
110110 $pages = do_search($page, 'AND', TRUE);
111111 foreach ($pages as $_page) {
112- if ($_page != $page)
112+ if ($_page !== $page)
113113 links_update($_page);
114114 }
115115 }
@@ -193,7 +193,7 @@ function links_add($page, $add, $rel_auto)
193193 foreach (file($ref_file) as $line) {
194194 list($ref_page, $ref_auto) = explode("\t", rtrim($line));
195195 if (! $ref_auto) $all_auto = FALSE;
196- if ($ref_page != $page) $ref .= $line;
196+ if ($ref_page !== $page) $ref .= $line;
197197 }
198198 unlink($ref_file);
199199 }
@@ -220,7 +220,7 @@ function links_delete($page, $del)
220220 $ref = '';
221221 foreach (file($ref_file) as $line) {
222222 list($ref_page, $ref_auto) = explode("\t", rtrim($line));
223- if ($ref_page != $page) {
223+ if ($ref_page !== $page) {
224224 if (! $ref_auto) $all_auto = FALSE;
225225 $ref .= $line;
226226 }
--- a/lib/make_link.php
+++ b/lib/make_link.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // $Id: make_link.php,v 1.38 2011/01/25 15:01:01 henoheno Exp $
44 // Copyright (C)
5-// 2003-2005 PukiWiki Developers Team
5+// 2003-2005, 2007 PukiWiki Developers Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -716,7 +716,7 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin
716716 $r_page = rawurlencode($page);
717717 $r_refer = ($refer == '') ? '' : '&amp;refer=' . rawurlencode($refer);
718718
719- if (! isset($related[$page]) && $page != $vars['page'] && is_page($page))
719+ if (! isset($related[$page]) && $page !== $vars['page'] && is_page($page))
720720 $related[$page] = get_filetime($page);
721721
722722 if ($isautolink || is_page($page)) {
--- a/plugin/edit.inc.php
+++ b/plugin/edit.inc.php
@@ -93,7 +93,7 @@ function plugin_edit_inline()
9393 $s_label = strip_htmltag(array_pop($args), FALSE);
9494
9595 $page = array_shift($args);
96- if ($page == NULL) $page = '';
96+ if ($page === NULL) $page = '';
9797 $_noicon = $_nolabel = FALSE;
9898 foreach($args as $arg){
9999 switch(strtolower($arg)){
--- a/plugin/include.inc.php
+++ b/plugin/include.inc.php
@@ -108,7 +108,7 @@ function plugin_include_convert()
108108 if ($with_title) {
109109 $link = '<a href="' . $script . '?cmd=edit&amp;page=' . $r_page .
110110 '">' . $s_page . '</a>';
111- if ($page == $menubar) {
111+ if ($page === $menubar) {
112112 $body = '<span align="center"><h5 class="side_label">' .
113113 $link . '</h5></span><small>' . $body . '</small>';
114114 } else {
--- a/plugin/menu.inc.php
+++ b/plugin/menu.inc.php
@@ -47,7 +47,7 @@ function plugin_menu_convert()
4747
4848 if (! is_page($page)) {
4949 return '';
50- } else if ($vars['page'] == $page) {
50+ } else if ($vars['page'] === $page) {
5151 return '<!-- #menu(): You already view ' . htmlsc($page) . ' -->';
5252 } else {
5353 // Cut fixed anchors
--- a/plugin/navi.inc.php
+++ b/plugin/navi.inc.php
@@ -100,7 +100,7 @@ function plugin_navi_convert()
100100
101101 $prev = $home;
102102 foreach ($pages as $page) {
103- if ($page == $current) break;
103+ if ($page === $current) break;
104104 $prev = $page;
105105 }
106106 $next = current($pages);
@@ -154,7 +154,7 @@ function plugin_navi_convert()
154154 } else {
155155 $ret .= '<ul>';
156156 foreach ($pages as $page)
157- if ($page != $home)
157+ if ($page !== $home)
158158 $ret .= ' <li>' . make_pagelink($page) . '</li>';
159159 $ret .= '</ul>';
160160 }
--- a/plugin/popular.inc.php
+++ b/plugin/popular.inc.php
@@ -81,7 +81,7 @@ function plugin_popular_convert()
8181 $page = substr($page, 1);
8282
8383 $s_page = htmlsc($page);
84- if ($page == $vars['page']) {
84+ if ($page === $vars['page']) {
8585 // No need to link itself, notifies where you just read
8686 $pg_passage = get_pg_passage($page,FALSE);
8787 $items .= ' <li><span title="' . $s_page . ' ' . $pg_passage . '">' .
--- a/plugin/rename.inc.php
+++ b/plugin/rename.inc.php
@@ -39,7 +39,7 @@ function plugin_rename_action()
3939 $page = plugin_rename_getvar('page');
4040 $refer = plugin_rename_getvar('refer');
4141
42- if ($refer === '') {
42+ if ($refer == '') {
4343 return plugin_rename_phase1();
4444
4545 } else if (! is_page($refer)) {
@@ -48,7 +48,7 @@ function plugin_rename_action()
4848 } else if ($refer === $whatsnew) {
4949 return plugin_rename_phase1('norename', $refer);
5050
51- } else if ($page === '' || $page === $refer) {
51+ } else if ($page == '' || $page === $refer) {
5252 return plugin_rename_phase2();
5353
5454 } else if (! is_pagename($page)) {