diff options
author | Josh <josh.t.richards@gmail.com> | 2024-07-01 15:07:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 15:07:04 -0400 |
commit | 3b353ede605260a31dc5a71832710298975ca1ad (patch) | |
tree | 95584197e598b0ea9133c13772a7177112a8fd93 | |
parent | 168384579f16372cd384c9453821821b79e6059b (diff) | |
download | nextcloud-server-jtr/fix-wipe-missing-token-handling.tar.gz nextcloud-server-jtr/fix-wipe-missing-token-handling.zip |
fixup: make nullable + switch to empty() for checkjtr/fix-wipe-missing-token-handling
Signed-off-by: Josh <josh.t.richards@gmail.com>
-rw-r--r-- | core/Controller/WipeController.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/Controller/WipeController.php b/core/Controller/WipeController.php index 6d3ff2aac1f..303d9e682d2 100644 --- a/core/Controller/WipeController.php +++ b/core/Controller/WipeController.php @@ -42,8 +42,8 @@ class WipeController extends Controller { * 404: Device should not be wiped */ #[FrontpageRoute(verb: 'POST', url: '/core/wipe/check')] - public function checkWipe(string $token = ''): JSONResponse { - if ($token !== '') { + public function checkWipe(?string $token = ''): JSONResponse { + if (!empty($token)) { try { if ($this->remoteWipe->start($token)) { return new JSONResponse([ @@ -76,8 +76,8 @@ class WipeController extends Controller { * 404: Device should not be wiped */ #[FrontpageRoute(verb: 'POST', url: '/core/wipe/success')] - public function wipeDone(string $token = ''): JSONResponse { - if ($token !== '') { + public function wipeDone(?string $token = ''): JSONResponse { + if (!empty($token)) { try { if ($this->remoteWipe->finish($token)) { return new JSONResponse([]); |