diff options
Diffstat (limited to 'lib/search.php')
-rw-r--r-- | lib/search.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/search.php b/lib/search.php index 99897ec7..2e91a3ef 100644 --- a/lib/search.php +++ b/lib/search.php @@ -160,7 +160,12 @@ function search_song($data,$operator,$method,$limit) { $table_sql .= "genre,"; break; case 'year': - $where_sql .= " song.year $value_string $operator"; + if (empty($data["year2"]) && is_numeric($data["year"])) { + $where_sql .= " song.year $value_string $operator"; + } + elseif (!empty($data["year"]) && is_numeric($data["year"]) && !empty($data["year2"]) && is_numeric($data["year2"])) { + $where_sql .= " (song.year BETWEEN ".$data["year"]." AND ".$data["year2"].") $operator"; + } break; case 'filename': $where_sql .= " song.file $value_string $operator"; |