Skip to content

Commit 76963e8

Browse files
committed
Duh, we have a sanitizer
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 36ec633 commit 76963e8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ jobs:
347347

348348
# START Other Tests Job (SQLite 3 and mssql)
349349
other-tests:
350-
runs-on: ubuntu-20.04 # TODO: Change back to 'ubuntu-22.04' when https://github.com/microsoft/mssql-docker/issues/899 resolved.
350+
runs-on: ubuntu-22.04
351351
strategy:
352352
matrix:
353353
include:

controller/manifest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use phpbb\language\language;
1616
use phpbb\path_helper;
1717
use phpbb\user;
18+
use phpbb\webpushnotifications\json\sanitizer as json_sanitizer;
1819
use Symfony\Component\HttpFoundation\JsonResponse;
1920
use Symfony\Component\HttpFoundation\Response;
2021

@@ -65,7 +66,7 @@ public function handle(): JsonResponse
6566

6667
$manifest = [
6768
'name' => $this->config['sitename'],
68-
'short_name' => $this->config['pwa_short_name'] ?: utf8_substr(preg_replace('/[^\x20-\x7E]/', '', $this->config['sitename']), 0, 12),
69+
'short_name' => $this->config['pwa_short_name'] ?: utf8_substr($this->config['sitename'], 0, 12),
6970
'display' => 'standalone',
7071
'orientation' => 'portrait',
7172
'dir' => $this->language->lang('DIRECTION'),
@@ -89,6 +90,6 @@ public function handle(): JsonResponse
8990
];
9091
}
9192

92-
return new JsonResponse($manifest);
93+
return new JsonResponse(json_sanitizer::sanitize($manifest));
9394
}
9495
}

0 commit comments

Comments
 (0)