You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Utils.php
+10-10
Original file line number
Diff line number
Diff line change
@@ -75,14 +75,14 @@ public static function checkRequirementExtension(): void
75
75
'mbstring' => '[WebPush] mbstring extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
76
76
'openssl' => '[WebPush] openssl extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
trigger_error("It is highly recommended to install the GMP or BCMath extension to speed up calculations. The fastest available calculator implementation will be automatically selected at runtime.", E_USER_NOTICE);
87
87
}
88
88
}
@@ -95,11 +95,11 @@ public static function checkRequirementKeyCipherHash(): void
95
95
'prime256v1' => '[WebPush] Openssl does not support required curve prime256v1.',
96
96
];
97
97
$availableCurves = openssl_get_curve_names();
98
-
if($availableCurves === false) {
98
+
if($availableCurves === false) {
99
99
trigger_error('[WebPush] Openssl does not support curves.', E_USER_WARNING);
100
100
} else {
101
-
foreach($requiredCurvesas$curve => $message) {
102
-
if(!in_array($curve, $availableCurves, true)) {
101
+
foreach($requiredCurvesas$curve => $message) {
102
+
if(!in_array($curve, $availableCurves, true)) {
103
103
trigger_error($message, E_USER_WARNING);
104
104
}
105
105
}
@@ -110,8 +110,8 @@ public static function checkRequirementKeyCipherHash(): void
110
110
'aes-128-gcm' => '[WebPush] Openssl does not support required cipher aes-128-gcm.',
111
111
];
112
112
$availableCiphers = openssl_get_cipher_methods();
113
-
foreach($requiredCiphersas$cipher => $message) {
114
-
if(!in_array($cipher, $availableCiphers, true)) {
113
+
foreach($requiredCiphersas$cipher => $message) {
114
+
if(!in_array($cipher, $availableCiphers, true)) {
115
115
trigger_error($message, E_USER_WARNING);
116
116
}
117
117
}
@@ -121,8 +121,8 @@ public static function checkRequirementKeyCipherHash(): void
121
121
'sha256' => '[WebPush] Php does not support required hmac hash sha256.',
thrownew \ValueError('Automatic padding is too large. Max is '.Encryption::MAX_PAYLOAD_LENGTH.'. Recommended max is '.Encryption::MAX_COMPATIBILITY_PAYLOAD_LENGTH.' for compatibility reasons (see README).');
346
347
}
347
-
if($automaticPadding < 0) {
348
+
if($automaticPadding < 0) {
348
349
thrownew \ValueError('Padding length should be positive or zero.');
0 commit comments