Skip to content

Commit 6ee2dc1

Browse files
authored
Merge pull request #18998 from uberbrady/fix_scim_error_email
Don't 500 on malformed emails input
2 parents e2ff7a7 + a51b17f commit 6ee2dc1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/Models/SnipeSCIMConfig.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ protected function doRead(&$object, $attributes = [])
196196
public function doWrite($operation, $subop, $value, Model &$object, Path $path = null, $removeIfNotSet = false)
197197
{
198198
if ($value) {
199-
$object->email = $value[0]['value'];
199+
try {
200+
$object->email = $value[0]['value'];
201+
} catch (\Exception $e) {
202+
\Log::debug($e);
203+
throw new SCIMException("Unknown email object: '" . print_r($value, true) . "'", 422);
204+
}
200205
} else {
201206
$object->email = null;
202207
}

0 commit comments

Comments
 (0)