mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update config() to config_cache()
This commit is contained in:
parent
e7b33c4cc6
commit
1d54204635
4 changed files with 16 additions and 16 deletions
|
@ -960,7 +960,7 @@ class ApiV1Controller extends Controller
|
|||
$res = [
|
||||
'approval_required' => false,
|
||||
'contact_account' => null,
|
||||
'description' => config('instance.description'),
|
||||
'description' => config_cache('app.description'),
|
||||
'email' => config('instance.email'),
|
||||
'invites_enabled' => false,
|
||||
'rules' => [],
|
||||
|
@ -979,7 +979,7 @@ class ApiV1Controller extends Controller
|
|||
'urls' => [],
|
||||
'version' => '2.7.2 (compatible; Pixelfed ' . config('pixelfed.version') . ')',
|
||||
'environment' => [
|
||||
'max_photo_size' => (int) config('pixelfed.max_photo_size'),
|
||||
'max_photo_size' => (int) config_cache('pixelfed.max_photo_size'),
|
||||
'max_avatar_size' => (int) config('pixelfed.max_avatar_size'),
|
||||
'max_caption_length' => (int) config('pixelfed.max_caption_length'),
|
||||
'max_bio_length' => (int) config('pixelfed.max_bio_length'),
|
||||
|
@ -1034,7 +1034,7 @@ class ApiV1Controller extends Controller
|
|||
return [
|
||||
'required',
|
||||
'mimes:' . config('pixelfed.media_types'),
|
||||
'max:' . config('pixelfed.max_photo_size'),
|
||||
'max:' . config_cache('pixelfed.max_photo_size'),
|
||||
];
|
||||
},
|
||||
'filter_name' => 'nullable|string|max:24',
|
||||
|
|
|
@ -501,7 +501,7 @@ class DirectMessageController extends Controller
|
|||
return [
|
||||
'required',
|
||||
'mimes:' . config('pixelfed.media_types'),
|
||||
'max:' . config('pixelfed.max_photo_size'),
|
||||
'max:' . config_cache('pixelfed.max_photo_size'),
|
||||
];
|
||||
},
|
||||
'to_id' => 'required'
|
||||
|
|
|
@ -28,7 +28,7 @@ class StoryController extends Controller
|
|||
return [
|
||||
'required',
|
||||
'mimes:image/jpeg,image/png,video/mp4',
|
||||
'max:' . config('pixelfed.max_photo_size'),
|
||||
'max:' . config_cache('pixelfed.max_photo_size'),
|
||||
];
|
||||
},
|
||||
]);
|
||||
|
|
|
@ -47,7 +47,7 @@ class MediaStorageService {
|
|||
empty($h['Content-Length']) ||
|
||||
empty($h['Content-Type']) ||
|
||||
$h['Content-Length'] < 10 ||
|
||||
$h['Content-Length'] > (config('pixelfed.max_photo_size') * 1000)
|
||||
$h['Content-Length'] > (config_cache('pixelfed.max_photo_size') * 1000)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ class MediaStorageService {
|
|||
];
|
||||
|
||||
$mime = $head['mime'];
|
||||
$max_size = (int) config('pixelfed.max_photo_size') * 1000;
|
||||
$max_size = (int) config_cache('pixelfed.max_photo_size') * 1000;
|
||||
$media->size = $head['length'];
|
||||
$media->remote_media = true;
|
||||
$media->save();
|
||||
|
|
Loading…
Reference in a new issue