Skip to content

Commit

Permalink
Fixed error parsing genre with special char
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturSierzant committed Dec 5, 2023
1 parent fe0ddfd commit 98f9a5b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/tidal_api/tidal_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function fixSSLcertificate(){
}

function connect() {
//return false;
//return -1;
if ($this->expiresAfter > time()) {
return true;
}
Expand Down
4 changes: 4 additions & 0 deletions include/new_albums_tidal.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
$( "#new_tidal" ).html('<div style="line-height: initial;">Error loading albums from Tidal.</div>');
}
});
request.fail(function(data) {
$( "#new_tidal" ).html('<div style="line-height: initial;">Error loading albums from Tidal.</div>');
});
</script>
<div class="full" id="new_tidal">
Expand Down
4 changes: 2 additions & 2 deletions include/tagProcessor.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function parseMultiGenreId($genre_id){
$genres = explode(';',$genre_id);
$where = '';
foreach ($genres as $g){
$where = ($where == '') ? ' genre_id LIKE "' . $g . '"' : $where . ' OR genre_id LIKE "' . $g . '"';
$where = ($where == '') ? ' genre_id LIKE "' . mysqli_real_escape_string($db,$g) . '"' : $where . ' OR genre_id LIKE "' . mysqli_real_escape_string($db,$g) . '"';
}
$query = mysqli_query($db,'SELECT genre, genre_id FROM genre WHERE ' . $where . ' ORDER BY genre');
while ($genre = mysqli_fetch_assoc($query)){
Expand All @@ -162,7 +162,7 @@ function parseMultiGenre($genre){
$genres = explode('ompd_genre_ompd',$genre);
$where = '';
foreach ($genres as $g){
$where = ($where == '') ? ' genre LIKE "' . $g . '"' : $where . ' OR genre LIKE "' . $g . '"';
$where = ($where == '') ? ' genre LIKE "' . mysqli_real_escape_string($db,$g) . '"' : $where . ' OR genre LIKE "' . mysqli_real_escape_string($db,$g) . '"';
}
$query = mysqli_query($db,'SELECT genre, genre_id FROM genre WHERE ' . $where . ' ORDER BY genre');
while ($genre = mysqli_fetch_assoc($query)){
Expand Down

0 comments on commit 98f9a5b

Please sign in to comment.