diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-11-29 18:38:46 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-11-29 18:38:46 +0000 |
commit | 245b69d645b0b00ef52063f08466e11e3bf09ccc (patch) | |
tree | 3deb277e6ae05d4821dcb5bdf86d34262c9f65cf /lib | |
parent | 73809f0c1dd345e572b2cea9503454f3a1bb2a12 (diff) | |
download | ampache-245b69d645b0b00ef52063f08466e11e3bf09ccc.tar.gz ampache-245b69d645b0b00ef52063f08466e11e3bf09ccc.tar.bz2 ampache-245b69d645b0b00ef52063f08466e11e3bf09ccc.zip |
some other minor changes, nothing big
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/api.class.php | 2 | ||||
-rw-r--r-- | lib/class/tag.class.php | 3 | ||||
-rw-r--r-- | lib/search.php | 11 |
3 files changed, 6 insertions, 10 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php index 7da358f5..6d65ec24 100644 --- a/lib/class/api.class.php +++ b/lib/class/api.class.php @@ -49,7 +49,7 @@ class Api { if (intval($version) < self::$version) { debug_event('API','Login Failed version too old','1'); - Error::add('api','Login Failed versoin too old'); + Error::add('api','Login Failed version too old'); return false; } diff --git a/lib/class/tag.class.php b/lib/class/tag.class.php index 0350e438..5018dbee 100644 --- a/lib/class/tag.class.php +++ b/lib/class/tag.class.php @@ -109,6 +109,9 @@ class Tag extends database_object { $data = self::get_top_tags($type,$object_id); } + // If nothing is found, then go ahead and return false + if (!is_array($data) OR !count($data)) { return false; } + $this->weight = $data[$this->id]['count']; if (in_array($GLOBALS['user']->id,$data[$this->id]['users'])) { diff --git a/lib/search.php b/lib/search.php index fe01ad0d..885dc27e 100644 --- a/lib/search.php +++ b/lib/search.php @@ -124,15 +124,8 @@ function search_song($data,$operator,$method,$limit) { { if($ii++ > 0) $where_sql .= " AND "; - $where_sql .= " - ( - song.title LIKE '%$word%' OR - album2.name LIKE '%$word%' OR - artist2.name LIKE '%$word%' OR - song.year LIKE '%$word%' OR - song.file LIKE '%$word%' OR - tag2.name LIKE '%$word%' - ) "; + $where_sql .= "(song.title LIKE '%$word%' OR album2.name LIKE '%$word%' OR artist2.name LIKE '%$word%' OR + song.year LIKE '%$word%' OR song.file LIKE '%$word%' OR tag2.name LIKE '%$word%') "; } $where_sql .= " ) $operator"; $table_sql .= " LEFT JOIN `album` as `album2` ON `song`.`album`=`album2`.`id`"; |