Commit 8be73298 authored by Jonas Haraldsson's avatar Jonas Haraldsson

Remove 'NULL' insertions at nowplaying

An earlier commit that tried to prevent Album.name = '' instead produces
Album.name = 'NULL' and also Track.mbid = 'NULL' because of incorrect
quoting of $album and $mbid vars in nowplaying/1.2/index.php

This commit fixes for the problem but we should add functions to
scrobbleutils.php for submissions/1.2/index.php and
nowplaying/1.2/index.php to use when trimming and quoting strings so
they dont diverge.
parent 718dfe86
......@@ -67,8 +67,12 @@ if (!$mbid) {
$session_id = $adodb->qstr($session_id);
$artist = $adodb->qstr($artist);
$track = $adodb->qstr($track);
$album = $adodb->qstr($album);
$mbid = $adodb->qstr($mbid);
if($album != 'NULL') {
$album = $adodb->qstr($album);
}
if ($mbid != 'NULL') {
$mbid = $adodb->qstr($mbid);
}
//Delete this user's last playing song (if any)
$adodb->Execute('DELETE FROM Now_Playing WHERE sessionid = ' . ($session_id));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment