diff options
Diffstat (limited to 'lib/class/catalog.class.php')
-rw-r--r-- | lib/class/catalog.class.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 3b164317..21ef2d08 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -1961,11 +1961,10 @@ class Catalog extends database_object { } // if it's a file // Check to see if it's a url from this ampache instance - elseif (substr($value,0,strlen(Config::get('web_path'))) == Config::get('web_path')) { - $song_id = intval(Song::parse_song_url($value)); - - $sql = "SELECT COUNT(*) FROM `song` WHERE `id`='$song_id'"; - $db_results = Dba::read($sql); + elseif (substr($value, 0, strlen(Config::get('web_path'))) == Config::get('web_path')) { + $data = Stream_URL::parse($value); + $sql = 'SELECT COUNT(*) FROM `song` WHERE `id` = ?'; + $db_results = Dba::read($sql, array($data['id'])); if (Dba::num_rows($db_results)) { $songs[] = $song_id; |