Skip to content

Commit 1a8f1d0

Browse files
author
Sebastian BURGIN-FIX (ext)
committed
wip
1 parent 1f20a59 commit 1a8f1d0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/Security/Presets/MyCspPreset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MyCspPreset implements Preset
1212
{
1313
public function configure(Policy $policy): void
1414
{
15-
$cdnHost = parse_url((string) env('AWS_CDN_ENDPOINT', ''), PHP_URL_HOST);
15+
$cdnHost = parse_url((string) config('filesystems.disks.s3.cdn_endpoint', ''), PHP_URL_HOST);
1616

1717
$scriptSources = array_filter([
1818
Keyword::SELF,

app/Support/CloudinaryUrl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
class CloudinaryUrl
66
{
7-
private const CLOUDINARY_HOST = 'res.cloudinary.com';
7+
private const string CLOUDINARY_HOST = 'res.cloudinary.com';
88

9-
private const UPLOAD_MARKER = '/image/upload/';
9+
private const string UPLOAD_MARKER = '/image/upload/';
1010

1111
public static function src(string $url, int $width): string
1212
{
@@ -46,7 +46,7 @@ private static function stripExistingTransforms(string $path): string
4646
$segments = explode('/', $path);
4747

4848
if (
49-
isset($segments[0])
49+
$segments[0] !== ''
5050
&& preg_match('/^[a-z0-9_,.-]+$/', $segments[0])
5151
&& preg_match('/[whcfq]_/', $segments[0])
5252
) {

0 commit comments

Comments
 (0)