diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2022-12-01 12:42:51 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2022-12-01 12:43:09 +0000 |
| commit | e3132a19b5bc5679ad08fb96ad3f19dbb09f5849 (patch) | |
| tree | 568fe35061cfc13b0c279664405d9ed9aeb2c1ce /app/Http/RequestHandlers/CreateSubmitterAction.php | |
| parent | 4c2188e419e716910897d0d969a178d28784c56a (diff) | |
| download | webtrees-e3132a19b5bc5679ad08fb96ad3f19dbb09f5849.tar.gz webtrees-e3132a19b5bc5679ad08fb96ad3f19dbb09f5849.tar.bz2 webtrees-e3132a19b5bc5679ad08fb96ad3f19dbb09f5849.zip | |
Fix: #4619 - cannot create new objects without a restriction
Diffstat (limited to 'app/Http/RequestHandlers/CreateSubmitterAction.php')
| -rw-r--r-- | app/Http/RequestHandlers/CreateSubmitterAction.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/Http/RequestHandlers/CreateSubmitterAction.php b/app/Http/RequestHandlers/CreateSubmitterAction.php index 835e85a8c0..99a6892db3 100644 --- a/app/Http/RequestHandlers/CreateSubmitterAction.php +++ b/app/Http/RequestHandlers/CreateSubmitterAction.php @@ -26,8 +26,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; -use function in_array; - /** * Process a form to create a new submitter. */ @@ -45,7 +43,7 @@ class CreateSubmitterAction implements RequestHandlerInterface $address = Validator::parsedBody($request)->string('submitter_address'); $email = Validator::parsedBody($request)->string('submitter_email'); $phone = Validator::parsedBody($request)->string('submitter_phone'); - $restriction = Validator::parsedBody($request)->string('restriction'); + $restriction = Validator::parsedBody($request)->isInArray(['', 'NONE', 'PRIVACY', 'CONFIDENTIAL', 'LOCKED'])->string('restriction'); // Fix non-printing characters $name = trim(preg_replace('/\s+/', ' ', $name)); @@ -64,7 +62,7 @@ class CreateSubmitterAction implements RequestHandlerInterface $gedcom .= "\n1 PHON " . $phone; } - if (in_array($restriction, ['none', 'privacy', 'confidential', 'locked'], true)) { + if ($restriction !== '') { $gedcom .= "\n1 RESN " . $restriction; } |
