extend debug check for non utf8 search results

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-06-09 14:08:51 +02:00
parent a39293aa75
commit a9c9db583e
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ class SearchController extends Controller {
if (!mb_check_encoding($result->name, 'utf8') || !mb_check_encoding($result->link, 'utf8')) {
throw new \Exception("Search result contains non utf8 data: " . $result->name);
}
$response = json_encode($result);
if ($response === false) {
throw new \Exception("Search result contains non utf8 data: " . $result->name);
}
}
return new JSONResponse($results);