Skip to content

Commit

Permalink
[KemonoBridge] attempt to fix malformed tag responses (#4209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantop authored Aug 10, 2024
1 parent 129b8a3 commit 2e6e246
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bridges/KemonoBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ public function collectData()
if (is_array($tags)) {
$item['categories'] = $tags;
} else {
$tags = preg_replace('/^{"?/', '["', $tags);
$tags = preg_replace('/"?}$/', '"]', $tags);
$item['categories'] = Json::decode($tags);
$tags = preg_replace('/^{/', '', $tags);
$tags = preg_replace('/}$/', '', $tags);
$tags = preg_replace('/"/', '', $tags);
$item['categories'] = explode(',', $tags);
}
}

Expand Down

0 comments on commit 2e6e246

Please sign in to comment.