Skip to content

Commit

Permalink
Duh, we have a sanitizer
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed Dec 3, 2024
1 parent 36ec633 commit 76963e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ jobs:

# START Other Tests Job (SQLite 3 and mssql)
other-tests:
runs-on: ubuntu-20.04 # TODO: Change back to 'ubuntu-22.04' when https://github.com/microsoft/mssql-docker/issues/899 resolved.
runs-on: ubuntu-22.04
strategy:
matrix:
include:
Expand Down
5 changes: 3 additions & 2 deletions controller/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use phpbb\language\language;
use phpbb\path_helper;
use phpbb\user;
use phpbb\webpushnotifications\json\sanitizer as json_sanitizer;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;

Expand Down Expand Up @@ -65,7 +66,7 @@ public function handle(): JsonResponse

$manifest = [
'name' => $this->config['sitename'],
'short_name' => $this->config['pwa_short_name'] ?: utf8_substr(preg_replace('/[^\x20-\x7E]/', '', $this->config['sitename']), 0, 12),
'short_name' => $this->config['pwa_short_name'] ?: utf8_substr($this->config['sitename'], 0, 12),
'display' => 'standalone',
'orientation' => 'portrait',
'dir' => $this->language->lang('DIRECTION'),
Expand All @@ -89,6 +90,6 @@ public function handle(): JsonResponse
];
}

return new JsonResponse($manifest);
return new JsonResponse(json_sanitizer::sanitize($manifest));
}
}

0 comments on commit 76963e8

Please sign in to comment.