librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1498] undo breakage to stable branch


From: Clint Adams
Subject: [Librefm-commits] [1498] undo breakage to stable branch
Date: Mon, 11 May 2009 23:36:43 +0000

Revision: 1498
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1498
Author:   clint
Date:     2009-05-11 23:36:42 +0000 (Mon, 11 May 2009)
Log Message:
-----------
undo breakage to stable branch

Modified Paths:
--------------
    branches/stable/gnukebox/submissions/1.2/index.php

Modified: branches/stable/gnukebox/submissions/1.2/index.php
===================================================================
--- branches/stable/gnukebox/submissions/1.2/index.php  2009-05-11 22:00:44 UTC 
(rev 1497)
+++ branches/stable/gnukebox/submissions/1.2/index.php  2009-05-11 23:36:42 UTC 
(rev 1498)
@@ -34,7 +34,7 @@
 
 $session_id = $_POST['s'];
 
-$username = $adodb->qstr(usernameFromSID($session_id));
+$username = $mdb2->quote(usernameFromSID($session_id), "text");
 $rowvalues = array();
 $actualcount = 0;
 
@@ -42,7 +42,7 @@
                switch (mb_detect_encoding($_POST['a'][$i])) {
                case "ASCII":
                case "UTF-8":
-                       $artist = $adodb->qstr($_POST['a'][$i]);
+                       $artist = $mdb2->quote($_POST['a'][$i], "text");
                        break;
                default:
                        die("FAILED Bad encoding in artist submission $i\n");
@@ -51,7 +51,7 @@
                switch (mb_detect_encoding($_POST['b'][$i])) {
                case "ASCII":
                case "UTF-8":
-                       $album = $adodb->qstr($_POST['b'][$i]);
+                       $album = $mdb2->quote($_POST['b'][$i], "text");
                        break;
                default:
                        die("FAILED Bad encoding in album submission $i\n");
@@ -71,7 +71,7 @@
        switch (mb_detect_encoding($_POST['t'][$i])) {
                case "ASCII":
                case "UTF-8":
-                   $track = $adodb->qstr($_POST['t'][$i]);
+                   $track = $mdb2->quote($_POST['t'][$i], "text");
                    break;
                default:
                        die("FAILED Bad encoding in title submission $i\n");
@@ -87,23 +87,23 @@
        $mb = validateMBID($_POST['m'][$i]);
 
        if($mb) {
-               $mbid = $adodb->qstr($mb);
+               $mbid = $mdb2->quote($mb, "text");
        } else {
                $mbid = 'NULL';
        }
 
        if(isset($_POST['o'][$i])) {
-               $source = $adodb->qstr($_POST['o'][$i]);
+               $source = $mdb2->quote($_POST['o'][$i], "text");
        } else {
                $source = 'NULL';
        }
        if(!empty($_POST['r'][$i])) {
-               $rating = $adodb->qstr($_POST['r'][$i]);
+               $rating = $mdb2->quote($_POST['r'][$i], "text");
        } else {
-               $rating = $adodb->qstr("0"); // use the fake rating code 0 for 
now
+               $rating = $mdb2->quote("0", "text"); // use the fake rating 
code 0 for now
        }
        if(isset($_POST['l'][$i])) {
-               $length = (int)($_POST['l'][$i]);
+               $length = $mdb2->quote($_POST['l'][$i], "integer");
        } else {
                $length = 'NULL';
        }
@@ -140,35 +140,33 @@
 
        if(($i+1) == count($_POST['a']) && $actualcount>0) {
 
-               $adodb->StartTrans();
+               $mdb2->exec("BEGIN");
 
                for($j = 0; $j < $actualcount; $j++) {
 
        // Scrobble!
                $sql = "INSERT INTO Scrobbles (username, artist, album, track, 
time, mbid, source, rating, length, stid) VALUES " . $rowvalues[$j];
-               $res =& $adodb->Execute($sql);
+               $res =& $mdb2->exec($sql);
                if(PEAR::isError($res)) {
                    $msg = $res->getMessage() . " - " . $res->getUserInfo();
-                   $adodb->FailTrans();
-                   $adodb->CompleteTrans();
+                   $mdb2->exec("ROLLBACK");
                    reportError($msg, $sql);
                     die("FAILED " . $msg . "\nError has been reported to site 
administrators.\n");
                }
 
                }
 
-               $adodb->CompleteTrans();
+               $mdb2->exec("COMMIT");
 
                if(PEAR::isError($res)) {
                    $msg = $res->getMessage() . " - " . $res->getUserInfo();
-                   $adodb->FailTrans();
-                   $adodb->CompleteTrans();
+                   $mdb2->exec("ROLLBACK");
                    reportError($msg, $sql);
                     die("FAILED " . $msg . "\nError has been reported to site 
administrators.\n");
                }
 
                // Destroy now_playing since it is almost certainly obsolescent
-               $adodb->Execute("DELETE FROM Now_Playing WHERE sessionid = " . 
$adodb->qstr($session_id));
+               $mdb2->exec("DELETE FROM Now_Playing WHERE sessionid = " . 
$mdb2->quote($session_id, "text"));
        }
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]