1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

Fix null warnings

- Fixed Avatars isset operator
- Added isset operator to openSSL data in files
- dns_get_record does not throw errors, instead it logs a warning and returns false. Altered code accordingly. PHP Bug Report: https://bugs.php.net/bug.php?id=73149
-
This commit is contained in:
Bradley Schofield 2022-11-09 11:45:15 +00:00
parent 44ca7d9459
commit 29c30a361b
3 changed files with 13 additions and 9 deletions

View file

@ -242,8 +242,8 @@ App::get('/v1/avatars/favicon')
case 'jpeg':
$size = \explode('x', \strtolower($sizes));
$sizeWidth = (int) $size[0] ?? 0;
$sizeHeight = (int) $size[1] ?? 0;
$sizeWidth = (int) ($size[0] ?? 0);
$sizeHeight = (int) ($size[1] ?? 0);
if (($sizeWidth * $sizeHeight) >= $space) {
$space = $sizeWidth * $sizeHeight;

View file

@ -565,10 +565,10 @@ App::post('/v1/storage/buckets/:bucketId/files')
'comment' => '',
'chunksTotal' => $chunks,
'chunksUploaded' => $chunksUploaded,
'openSSLVersion' => $openSSLVersion,
'openSSLCipher' => $openSSLCipher,
'openSSLTag' => $openSSLTag,
'openSSLIV' => $openSSLIV,
'openSSLVersion' => $openSSLVersion ?? null,
'openSSLCipher' => $openSSLCipher ?? null,
'openSSLTag' => $openSSLTag ?? null,
'openSSLIV' => $openSSLIV ?? null,
'search' => implode(' ', [$fileId, $fileName]),
'metadata' => $metadata,
]);
@ -581,9 +581,9 @@ App::post('/v1/storage/buckets/:bucketId/files')
->setAttribute('mimeType', $mimeType)
->setAttribute('sizeActual', $sizeActual)
->setAttribute('algorithm', $algorithm)
->setAttribute('openSSLVersion', $openSSLVersion)
->setAttribute('openSSLCipher', $openSSLCipher)
->setAttribute('openSSLTag', $openSSLTag)
->setAttribute('openSSLVersion', $openSSLVersion ?? null)
->setAttribute('openSSLCipher', $openSSLCipher ?? null)
->setAttribute('openSSLTag', $openSSLTag ?? null)
->setAttribute('openSSLIV', $openSSLIV)
->setAttribute('metadata', $metadata)
->setAttribute('chunksUploaded', $chunksUploaded);

View file

@ -46,6 +46,10 @@ class CNAME extends Validator
return false;
}
if (!$records) {
return false;
}
foreach ($records as $record) {
if (isset($record['target']) && $record['target'] === $this->target) {
return true;