OSDN Git Service

BugTrack2/236: If you compare two numerical strings, they are compared as integers
authorhenoheno <henoheno>
Sun, 19 Aug 2007 14:20:58 +0000 (23:20 +0900)
committerumorigu <umorigu@gmail.com>
Sun, 30 Nov 2014 00:59:06 +0000 (09:59 +0900)
plugin/article.inc.php
plugin/comment.inc.php
plugin/edit.inc.php
plugin/insert.inc.php
plugin/memo.inc.php
plugin/paint.inc.php
plugin/pcomment.inc.php
plugin/vote.inc.php

index 41f2f25..e9d2865 100644 (file)
@@ -88,7 +88,7 @@ function plugin_article_action()
        $postdata_input = $article . "\n";
        $body = '';
 
-       if (md5(@join('', get_source($post['refer']))) != $post['digest']) {
+       if (md5(get_source($post['refer'], TRUE, TRUE)) !== $post['digest']) {
                $title = $_title_collided;
 
                $body = $_msg_collided . "\n";
index e52a5e0..32dd4c5 100644 (file)
@@ -68,7 +68,7 @@ function plugin_comment_action()
 
        $title = $_title_updated;
        $body = '';
-       if (md5(@join('', get_source($vars['refer']))) != $vars['digest']) {
+       if (md5(get_source($vars['refer'], TRUE, TRUE)) !== $vars['digest']) {
                $title = $_title_comment_collided;
                $body  = $_msg_comment_collided . make_pagelink($vars['refer']);
        }
index dda7ff6..8fc0418 100644 (file)
@@ -190,7 +190,7 @@ function plugin_edit_write()
        // Collision Detection
        $oldpagesrc = join('', get_source($page));
        $oldpagemd5 = md5($oldpagesrc);
-       if ($digest != $oldpagemd5) {
+       if ($digest !== $oldpagemd5) {
                $vars['digest'] = $oldpagemd5; // Reset
 
                $original = isset($vars['original']) ? $vars['original'] : '';
index b19a181..bcf5e52 100644 (file)
@@ -36,7 +36,7 @@ function plugin_insert_action()
        $postdata_input = $insert . "\n";
 
        $body = '';
-       if (md5(@join('', get_source($vars['refer']))) != $vars['digest']) {
+       if (md5(get_source($vars['refer'], TRUE, TRUE)) !== $vars['digest']) {
                $title = $_title_collided;
                $body  = $_msg_collided . "\n";
 
index c0e6fe8..cba06c2 100644 (file)
@@ -36,7 +36,7 @@ function plugin_memo_action()
        $postdata_input = $memo_body . "\n";
 
        $body = '';
-       if (md5(@join('', get_source($vars['refer']))) != $vars['digest']) {
+       if (md5(get_source($vars['refer'], TRUE, TRUE)) !== $vars['digest']) {
                $title = $_title_collided;
                $body  = $_msg_collided . "\n";
 
index 6a7802e..347d655 100644 (file)
@@ -256,7 +256,7 @@ function paint_insert_ref($filename)
        }
 
        // ¹¹¿·¤Î¾×Æͤò¸¡½Ð
-       if (md5(join('',$postdata_old)) != $vars['digest'])
+       if (md5(join('',$postdata_old)) !== $vars['digest'])
        {
                $ret['msg'] = $_paint_messages['msg_title_collided'];
                $ret['body'] = $_paint_messages['msg_collided'];
index e56ee8b..6dadab0 100644 (file)
@@ -209,7 +209,7 @@ function plugin_pcomment_insert()
                $count    = count($postdata);
 
                $digest = isset($vars['digest']) ? $vars['digest'] : '';
-               if (md5(join('', $postdata)) != $digest) {
+               if (md5(join('', $postdata)) !== $digest) {
                        $ret['msg']  = $_pcmt_messages['title_collided'];
                        $ret['body'] = $_pcmt_messages['msg_collided'];
                }
index dd32508..afd10d8 100644 (file)
@@ -47,7 +47,7 @@ function plugin_vote_action()
                $postdata      .= $vote_str;
        }
 
-       if (md5(@join('', get_source($vars['refer']))) != $vars['digest']) {
+       if (md5(get_source($vars['refer'], TRUE, TRUE)) !== $vars['digest']) {
                $title = $_title_collided;
 
                $s_refer          = htmlsc($vars['refer']);