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 (
|
if (
|
||||||
!$request->has('key')
|
!$request->has('key')
|
||||||
|| !preg_match('/^[\da-f]{32}$/', $request->input('key'))
|
|| !$request->input('key')
|
||||||
|| !$user
|
|| !$user
|
||||||
) {
|
) {
|
||||||
throw new HttpForbidden('{"error":"Missing or invalid key"}', ['content-type' => 'application/json']);
|
throw new HttpForbidden('{"error":"Missing or invalid key"}', ['content-type' => 'application/json']);
|
||||||
|
|
|
@ -15,7 +15,7 @@ function user_atom()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!$request->has('key')
|
!$request->has('key')
|
||||||
|| !preg_match('/^[\da-f]{32}$/', $request->input('key'))
|
|| !$request->input('key')
|
||||||
|| empty($user)
|
|| empty($user)
|
||||||
) {
|
) {
|
||||||
throw new HttpForbidden('Missing or invalid key', ['content-type' => 'text/text']);
|
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>
|
<title>' . config('app_name') . '</title>
|
||||||
<id>' . $request->getHttpHost()
|
<id>' . $request->getHttpHost()
|
||||||
. htmlspecialchars(preg_replace(
|
. htmlspecialchars(preg_replace(
|
||||||
'#[&?]key=[a-f\d]{32}#',
|
'#[&?]key=[a-f\d]+#',
|
||||||
'',
|
'',
|
||||||
$request->getRequestUri()
|
$request->getRequestUri()
|
||||||
))
|
))
|
||||||
|
|
|
@ -13,7 +13,7 @@ function user_ical()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!$request->has('key')
|
!$request->has('key')
|
||||||
|| !preg_match('/^[\da-f]{32}$/', $request->input('key'))
|
|| !$request->input('key')
|
||||||
|| !$user
|
|| !$user
|
||||||
) {
|
) {
|
||||||
throw new HttpForbidden('Missing or invalid key', ['content-type' => 'text/text']);
|
throw new HttpForbidden('Missing or invalid key', ['content-type' => 'text/text']);
|
||||||
|
|
Loading…
Reference in New Issue