Revisión | 866348fee598452e32462df058ad0a241266083d (tree) |
---|---|
Tiempo | 2014-11-26 02:45:23 |
Autor | henoheno <henoheno> |
Commiter | umorigu |
BugTrack2/236: "===" for two numerical strings. Can't rename "1" to "01".
@@ -39,16 +39,16 @@ 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)) { |
46 | 46 | return plugin_rename_phase1('notpage', $refer); |
47 | 47 | |
48 | - } else if ($refer == $whatsnew) { | |
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)) { |
@@ -394,7 +394,7 @@ function plugin_rename_getrelated($page) | ||
394 | 394 | $pages = get_existpages(); |
395 | 395 | $pattern = '/(?:^|\/)' . preg_quote(strip_bracket($page), '/') . '(?:\/|$)/'; |
396 | 396 | foreach ($pages as $name) { |
397 | - if ($name == $page) continue; | |
397 | + if ($name === $page) continue; | |
398 | 398 | if (preg_match($pattern, $name)) $related[] = $name; |
399 | 399 | } |
400 | 400 | return $related; |
@@ -406,9 +406,9 @@ function plugin_rename_getselecttag($page) | ||
406 | 406 | |
407 | 407 | $pages = array(); |
408 | 408 | foreach (get_existpages() as $_page) { |
409 | - if ($_page == $whatsnew) continue; | |
409 | + if ($_page === $whatsnew) continue; | |
410 | 410 | |
411 | - $selected = ($_page == $page) ? ' selected' : ''; | |
411 | + $selected = ($_page === $page) ? ' selected' : ''; | |
412 | 412 | $s_page = htmlsc($_page); |
413 | 413 | $pages[$_page] = '<option value="' . $s_page . '"' . $selected . '>' . |
414 | 414 | $s_page . '</option>'; |