From 3f8f77dff102d3a63ce7b74dcf64e8860ba35165 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 4 May 2020 10:42:13 +0000 Subject: [PATCH] [CORE] Fix 'Array and string offset access syntax with curly braces is deprecated' in AuthCryptModule and DirectionDetectorPlugin --- modules/AuthCrypt/AuthCryptModule.php | 4 ++-- plugins/DirectionDetector/DirectionDetectorPlugin.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/AuthCrypt/AuthCryptModule.php b/modules/AuthCrypt/AuthCryptModule.php index dcacd3cfc6..747369ddec 100644 --- a/modules/AuthCrypt/AuthCryptModule.php +++ b/modules/AuthCrypt/AuthCryptModule.php @@ -85,7 +85,7 @@ class AuthCryptModule extends AuthenticationModule $salt = ''; for ($i=0; $i<$len; $i++) { - $salt .= $chars{mt_rand(0, strlen($chars)-1)}; + $salt .= $chars[mt_rand(0, strlen($chars)-1)]; } return $salt; @@ -185,4 +185,4 @@ class AuthCryptModule extends AuthenticationModule _m('Authentication and password hashing with crypt()')); return true; } -} \ No newline at end of file +} diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index deaf820826..9b744334c1 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -143,7 +143,7 @@ class DirectionDetectorPlugin extends Plugin { $len = strlen($str); for($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); + $in = ord($str[$i]); if (0 == $mState) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence.