Fix atom, ical and json exports
This commit is contained in:
parent
f835a7538c
commit
700d841a87
|
@ -386,7 +386,7 @@ function shifts_json_export_controller()
|
|||
|
||||
if (
|
||||
!$request->has('key')
|
||||
|| !preg_match('/^[\da-f]{32}$/', $request->input('key'))
|
||||
|| !$request->input('key')
|
||||
|| !$user
|
||||
) {
|
||||
throw new HttpForbidden('{"error":"Missing or invalid key"}', ['content-type' => 'application/json']);
|
||||
|
|
|
@ -15,7 +15,7 @@ function user_atom()
|
|||
|
||||
if (
|
||||
!$request->has('key')
|
||||
|| !preg_match('/^[\da-f]{32}$/', $request->input('key'))
|
||||
|| !$request->input('key')
|
||||
|| empty($user)
|
||||
) {
|
||||
throw new HttpForbidden('Missing or invalid key', ['content-type' => 'text/text']);
|
||||
|
@ -50,7 +50,7 @@ function make_atom_entries_from_news($news_entries)
|
|||
<title>' . config('app_name') . '</title>
|
||||
<id>' . $request->getHttpHost()
|
||||
. htmlspecialchars(preg_replace(
|
||||
'#[&?]key=[a-f\d]{32}#',
|
||||
'#[&?]key=[a-f\d]+#',
|
||||
'',
|
||||
$request->getRequestUri()
|
||||
))
|
||||
|
|
|
@ -13,7 +13,7 @@ function user_ical()
|
|||
|
||||
if (
|
||||
!$request->has('key')
|
||||
|| !preg_match('/^[\da-f]{32}$/', $request->input('key'))
|
||||
|| !$request->input('key')
|
||||
|| !$user
|
||||
) {
|
||||
throw new HttpForbidden('Missing or invalid key', ['content-type' => 'text/text']);
|
||||
|
|
Loading…
Reference in New Issue