From: Seamus Lee Date: Sat, 13 Jun 2020 07:20:47 +0000 (+1000) Subject: [REF] Fix some additional issues where curly braces were being used to access string... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=84ce59b193627902a6e6a49708e5dea705092d1c;p=civicrm-core.git [REF] Fix some additional issues where curly braces were being used to access string or array offsets --- diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index b7597bfe5f..a2ee643cbe 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -618,7 +618,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { //checks the given custom field name doesnot start with digit if (!empty($title)) { // gives the ascii value - $asciiValue = ord($title{0}); + $asciiValue = ord($title[0]); if ($asciiValue >= 48 && $asciiValue <= 57) { $errors['label'] = ts("Name cannot not start with a digit"); } diff --git a/CRM/Utils/Number.php b/CRM/Utils/Number.php index ff25473595..3dae925661 100644 --- a/CRM/Utils/Number.php +++ b/CRM/Utils/Number.php @@ -75,7 +75,7 @@ class CRM_Utils_Number { */ public static function formatUnitSize($size, $checkForPostMax = FALSE) { if ($size) { - $last = strtolower($size{strlen($size) - 1}); + $last = strtolower($size[strlen($size) - 1]); $size = (int) $size; switch ($last) { // The 'G' modifier is available since PHP 5.1.0 diff --git a/Civi/Core/Themes.php b/Civi/Core/Themes.php index 9156eb5558..dee905485f 100644 --- a/Civi/Core/Themes.php +++ b/Civi/Core/Themes.php @@ -135,7 +135,7 @@ class Themes { public function getAvailable() { $result = []; foreach ($this->getAll() as $key => $theme) { - if ($key{0} !== '_') { + if ($key[0] !== '_') { $result[$key] = $theme['title']; } }