[PHP 8.1] Deprecated function: strcasecmp(): Passing null to parameter #1 ($string1) of type string is deprecated

Created on 4 January 2023, over 1 year ago
Updated 17 February 2023, over 1 year ago

Problem/Motivation

There are actually two problems after updating to php 8.1 -
1. [PHP 8.0] Deprecated function: strcasecmp(): Passing null to parameter #1 ($string1) of type string is deprecated
2. Undefined array key 1

Steps to reproduce

Update to php 8.1 and you will see those error.

Proposed resolution

In ckeditor_config/src/Plugin/CKEditorPlugin/CustomConfig.php, change from this -

// Loop through config lines and append to editorSettings.
      foreach ($config_array as $config_value) {
        $exploded_value = explode(" = ", $config_value);
        $key = $exploded_value[0];
        $value = $exploded_value[1];

to this -

// Loop through config lines and append to editorSettings.
      foreach ($config_array as $config_value) {
        $exploded_value = explode(" = ", $config_value);
        $key = $exploded_value[0];
        $value = isset($exploded_value[1]) ? $exploded_value[1] : '';
        $value = ($value === 0 || $value === NULL) ? '' : $value;

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia Nadim Hossain

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024