From 7be441d16d4e0be272c1f9e195de18748ea12835 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 11 Jun 2020 08:40:26 +1000 Subject: [PATCH] [REF] Using {} to access string or array offsets has been deprecated in PHP7.4 --- CRM/Mailing/BAO/MailingJob.php | 2 +- CRM/Utils/SQL/Insert.php | 2 +- Civi/Core/Resolver.php | 2 +- ext/sequentialcreditnotes/sequentialcreditnotes.civix.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index 5fc03b14d3..8ebd890834 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -781,7 +781,7 @@ VALUES (%1, %2, %3, %4, %5, %6, %7) } // Register 5xx SMTP response code (permanent failure) as bounce. - if (isset($code{0}) && $code{0} === '5') { + if (isset($code[0]) && $code[0] === '5') { return FALSE; } diff --git a/CRM/Utils/SQL/Insert.php b/CRM/Utils/SQL/Insert.php index 816c89f605..f70cbc5d80 100644 --- a/CRM/Utils/SQL/Insert.php +++ b/CRM/Utils/SQL/Insert.php @@ -67,7 +67,7 @@ class CRM_Utils_SQL_Insert { $value = NULL; } // Skip '_foobar' and '{\u00}*_options' and 'N'. - if (preg_match('/[a-zA-Z]/', $key{0}) && $key !== 'N') { + if (preg_match('/[a-zA-Z]/', $key[0]) && $key !== 'N') { $row[$key] = $value; } } diff --git a/Civi/Core/Resolver.php b/Civi/Core/Resolver.php index a1ebfe2b0f..a3950c74e9 100644 --- a/Civi/Core/Resolver.php +++ b/Civi/Core/Resolver.php @@ -95,7 +95,7 @@ class Resolver { // Callback: Constant value. return new ResolverConstantCallback((int) $id); } - elseif ($id{0} >= 'A' && $id{0} <= 'Z') { + elseif ($id[0] >= 'A' && $id[0] <= 'Z') { // Object: New/default instance. return new $id(); } diff --git a/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php b/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php index 09228ba9d6..891a0c069c 100644 --- a/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php +++ b/ext/sequentialcreditnotes/sequentialcreditnotes.civix.php @@ -244,7 +244,7 @@ function _sequentialcreditnotes_civix_find_files($dir, $pattern) { if ($dh = opendir($subdir)) { while (FALSE !== ($entry = readdir($dh))) { $path = $subdir . DIRECTORY_SEPARATOR . $entry; - if ($entry{0} == '.') { + if ($entry[0] == '.') { } elseif (is_dir($path)) { $todos[] = $path; -- 2.25.1