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) {