diff options
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/catalog.class.php | 4 | ||||
-rw-r--r-- | lib/class/playlist.class.php | 17 | ||||
-rw-r--r-- | lib/class/radio.class.php | 15 |
3 files changed, 27 insertions, 9 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index f07c1b9a..c3aaae96 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -467,7 +467,7 @@ class Catalog { $file = str_replace(array('(',')','\''),'',$full_file); echo "<script type=\"text/javascript\">\n"; echo "update_txt('" . $this->count ."','add_count_" . $this->id . "');"; - echo "update_txt('" . htmlentities($file) . "','add_dir_" . $this->id . "');"; + echo "update_txt('" . addslashes(htmlentities($file)) . "','add_dir_" . $this->id . "');"; echo "\n</script>\n"; flush(); } // update our current state @@ -583,7 +583,7 @@ class Catalog { if ( !($search_count%5)) { echo "<script type=\"text/javascript\">\n"; echo "update_txt('" . $search_count ."','count_art_" . $this->id . "');"; - echo "update_txt('" . $album->name . "','read_art_" . $this->id . "');"; + echo "update_txt('" . addslashes($album->name) . "','read_art_" . $this->id . "');"; echo "\n</script>\n"; flush(); } //echos song count diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php index 515edde4..b36cf268 100644 --- a/lib/class/playlist.class.php +++ b/lib/class/playlist.class.php @@ -486,16 +486,19 @@ class Playlist { * delete * This deletes the current playlist and all assoicated data */ - function delete() { + public function delete() { - $id = sql_escape($this->id); - - $sql = "DELETE FROM playlist_data WHERE playlist = '$id'"; - $db_results = mysql_query($sql, dbh()); + $id = Dba::escape($this->id); + + $sql = "DELETE FROM `playlist_data` WHERE `playlist` = '$id'"; + $db_results = Dba::query($sq); - $sql = "DELETE FROM playlist WHERE id='$id'"; - $db_results = mysql_query($sql, dbh()); + $sql = "DELETE FROM `playlist` WHERE `id`='$id'"; + $db_results = Dba::query($sql); + $sql = "DELETE FROM `object_count` WHERE `object_type`='playlist' AND `object_id`='$id'"; + $db_results = Dba::query($sql); + return true; } // delete diff --git a/lib/class/radio.class.php b/lib/class/radio.class.php index 45f57ade..7665c887 100644 --- a/lib/class/radio.class.php +++ b/lib/class/radio.class.php @@ -200,6 +200,21 @@ class Radio { } // create + /** + * delete + * This deletes the current object from the database + */ + public function delete() { + + $id = Dba::escape($this->id); + + $sql = "DELETE FROM `live_stream` WHERE `id`='$id'"; + $db_results = Dba::query($sql); + + return true; + + } // delete + } //end of radio class ?> |