From c6da975e8ff71439ef3937452363fc016134ef58 Mon Sep 17 00:00:00 2001 From: Arun Philip Date: Thu, 18 Jan 2024 09:57:06 -0500 Subject: [PATCH] [custom field] mb_substr($fieldInfo->name, 1) string must be cast to int to do arithmetic" --- src/FamilyCustomFieldsEditor.php | 2 +- src/PersonCustomFieldsEditor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FamilyCustomFieldsEditor.php b/src/FamilyCustomFieldsEditor.php index 383f5c8c0a..205df418c1 100644 --- a/src/FamilyCustomFieldsEditor.php +++ b/src/FamilyCustomFieldsEditor.php @@ -136,7 +136,7 @@ // doesn't allow numeric-only field (table column) names. $fields = mysqli_query($cnInfoCentral, 'SELECT * FROM family_custom'); $fieldInfo = mysqli_fetch_field_direct($fields, $last); - $newFieldNum = mb_substr($fieldInfo->name, 1) + 1; + $newFieldNum = (int) mb_substr($fieldInfo->name, 1) + 1; // If we're inserting a new custom-list type field, // create a new list and get its ID diff --git a/src/PersonCustomFieldsEditor.php b/src/PersonCustomFieldsEditor.php index 79a55c9ac9..d98fd99b38 100644 --- a/src/PersonCustomFieldsEditor.php +++ b/src/PersonCustomFieldsEditor.php @@ -127,7 +127,7 @@ // The "c#" naming scheme is necessary because MySQL 3.23 doesn't allow numeric-only field (table column) names. $fields = mysqli_query($cnInfoCentral, 'SELECT * FROM person_custom'); $fieldInfo = mysqli_fetch_field_direct($fields, $last); - $newFieldNum = mb_substr($fieldInfo->name, 1) + 1; + $newFieldNum = (int) mb_substr($fieldInfo->name, 1) + 1; // If we're inserting a new custom-list type field, create a new list and get its ID if ($newFieldType == 12) {