librefm-commits
[Top][All Lists]
Advanced

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

[Librefm-commits] [1196] move db quoting back to the index.php files


From: Clint Adams
Subject: [Librefm-commits] [1196] move db quoting back to the index.php files
Date: Tue, 05 May 2009 01:29:40 +0000

Revision: 1196
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1196
Author:   clint
Date:     2009-05-05 01:29:40 +0000 (Tue, 05 May 2009)
Log Message:
-----------
move db quoting back to the index.php files

Modified Paths:
--------------
    trunk/gnukebox/nowplaying/1.2/index.php
    trunk/gnukebox/scrobble-utils.php
    trunk/gnukebox/submissions/1.2/index.php

Modified: trunk/gnukebox/nowplaying/1.2/index.php
===================================================================
--- trunk/gnukebox/nowplaying/1.2/index.php     2009-05-05 01:06:46 UTC (rev 
1195)
+++ trunk/gnukebox/nowplaying/1.2/index.php     2009-05-05 01:29:40 UTC (rev 
1196)
@@ -46,8 +46,14 @@
        $expires = time() + 250; //Expire in 5 minutes if we don't know the 
track length
 }
 
-$mbid = validateMBID($_POST['m']);
+$mb = validateMBID($_POST['m']);
 
+if($mb) {
+       $mbid = $mdb2->quote($mb, "text");
+} else {
+       $mbid = 'NULL';
+}
+
 createArtistIfNew($artist);
 if($album != 'NULL') {
        createAlbumIfNew($artist, $album);

Modified: trunk/gnukebox/scrobble-utils.php
===================================================================
--- trunk/gnukebox/scrobble-utils.php   2009-05-05 01:06:46 UTC (rev 1195)
+++ trunk/gnukebox/scrobble-utils.php   2009-05-05 01:29:40 UTC (rev 1196)
@@ -211,16 +211,15 @@
 }
 
 function validateMBID ($input) {
-
 if(isset($input)) {
        $input = strtolower(rtrim($input));
        
if(preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/',
 $input)) {
-               return $mdb2->quote($input, "text");
+               return $input;
        } else {
-               return 'NULL';
+               return null;
        }
 } else {
-       return 'NULL';
+       return null;
 }
 
 }

Modified: trunk/gnukebox/submissions/1.2/index.php
===================================================================
--- trunk/gnukebox/submissions/1.2/index.php    2009-05-05 01:06:46 UTC (rev 
1195)
+++ trunk/gnukebox/submissions/1.2/index.php    2009-05-05 01:29:40 UTC (rev 
1196)
@@ -84,8 +84,14 @@
                $time = strtotime($_POST['i'][$i]);
        }
 
-       $mbid = validateMBID($_POST['m']);
+       $mb = validateMBID($_POST['m']);
 
+       if($mb) {
+               $mbid = $mdb2->quote($mb, "text");
+       } else {
+               $mbid = 'NULL';
+       }
+
        if(isset($_POST['o'][$i])) {
                $source = $mdb2->quote($_POST['o'][$i], "text");
        } else {





reply via email to

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