[geeklog-cvs] geeklog: Fixed bug where $rht wasn't initialized before use.

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Mar 6 14:49:28 EST 2010


changeset 7766:7b7880e1a297
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/7b7880e1a297
user: vinny
date: Sat Mar 06 12:47:53 2010 -0700
description:
Fixed bug where $rht wasn't initialized before use.

diffstat:

 system/lib-comment.php |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (26 lines):

diff -r aaa84495a848 -r 7b7880e1a297 system/lib-comment.php
--- a/system/lib-comment.php	Sun Feb 28 19:29:31 2010 +0100
+++ b/system/lib-comment.php	Sat Mar 06 12:47:53 2010 -0700
@@ -1161,20 +1161,16 @@
             $ret = 4; // Cannot return here, tables locked!
         }
     } else {
-        $rht2=$rht+1;
-        $rht3=$rht+2;
         $rht = DB_getItem($_TABLES['comments'], 'MAX(rht)', "sid = '$sid'");
         if ( DB_error() ) {
             $rht = 0;
         }
+        $rht2=$rht+1;
+        $rht3=$rht+2;
         if (isset($name)) {
             DB_save ($_TABLES['comments'], 'sid,uid,comment,date,title,pid,lft,rht,indent,type,ipaddress,name',
                 "'$sid',$uid,'$comment',now(),'$title',$pid,$rht2,$rht3,0,'$type','{$_SERVER['REMOTE_ADDR']}','$name'");
         } else {
-            $rht = DB_getItem($_TABLES['comments'], 'MAX(rht)', "sid = '$sid'");
-            if ( DB_error() ) {
-                $rht = 0;
-            }
             DB_save ($_TABLES['comments'], 'sid,uid,comment,date,title,pid,lft,rht,indent,type,ipaddress',
                 "'$sid',$uid,'$comment',now(),'$title',$pid,$rht2,$rht3,0,'$type','{$_SERVER['REMOTE_ADDR']}'");
         }



More information about the geeklog-cvs mailing list