Skip to content

Commit c190da8

Browse files
authored
Used shorthand if/else to assign variables
1 parent e53cbf8 commit c190da8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
|--------------------------------------------------------------------------
108108
*/
109109

110-
if (ENFORCE_SSL == FALSE) { $http_protocol = 'http://'; } else { $http_protocol = 'https://'; }
111-
if (! empty(dirname($_SERVER['SCRIPT_NAME']))) { $subfolder = dirname($_SERVER['SCRIPT_NAME']); } else { $subfolder = ''; }
110+
$http_protocol = (ENFORCE_SSL == FALSE) ? 'http://' : 'https://';
111+
$subfolder = (! empty(dirname($_SERVER['SCRIPT_NAME']))) ? dirname($_SERVER['SCRIPT_NAME']) : '';
112112

113113
define('BASE_URL', $http_protocol . $_SERVER['SERVER_NAME'] . $subfolder . '/');
114114

functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function encrypt_v1($plaintext) {
382382
// Initialization vector
383383
$iv = random_bytes(16);
384384

385-
if ( $cipher == 'aes-256-gcm' || $cipher == 'AES-256-GCM' ) {
385+
if ($cipher == 'aes-256-gcm') {
386386

387387
$ciphertext = openssl_encrypt($plaintext, $cipher, $key, $options=0, $iv, $tag);
388388
return $version . '::' . base64_encode($ciphertext) . '::' . base64_encode($iv) . '::' . base64_encode($tag) . '::' . base64_encode($salt_key);
@@ -426,7 +426,7 @@ function decrypt_v1($encrypted) {
426426
// Cipher method to AES with 256-bit key
427427
$cipher = strtolower(CIPHER_METHOD);
428428

429-
if ( $cipher == 'aes-256-gcm' || $cipher == 'AES-256-GCM' ) {
429+
if ($cipher == 'aes-256-gcm') {
430430

431431
list($version, $ciphertext, $iv, $tag, $salt_key) = explode('::', $encrypted);
432432
$ciphertext = base64_decode($ciphertext);

0 commit comments

Comments
 (0)