Skip to content

PHP 8+ warnings, "undefined array key", margins lines 671-4 and 695 #272

Description

@nerun

PHP Warnings:

Undefined array key "margin-top" in .../lib/plugins/wrap/helper.php on line 671
Undefined array key "margin-right" in .../lib/plugins/wrap/helper.php on line 672
Undefined array key "margin-bottom" in .../lib/plugins/wrap/helper.php on line 673
Undefined array key "margin-left" in .../lib/plugins/wrap/helper.php on line 674
Undefined array key "float" in .../lib/plugins/wrap/helper.php on line 695

In helper.php (lines 671-4 and 695), I have changed these lines:

$margin_top = $css_properties ['margin-top'];
$margin_right = $css_properties ['margin-right'];
$margin_bottom = $css_properties ['margin-bottom'];
$margin_left = $css_properties ['margin-left'];
...
$frame_props ['float'] = $css_properties ['float'];

To:

$margin_top = $css_properties ['margin-top'] ?? null;
$margin_right = $css_properties ['margin-right'] ?? null;
$margin_bottom = $css_properties ['margin-bottom'] ?? null;
$margin_left = $css_properties ['margin-left'] ?? null;
...
$frame_props ['float'] = $css_properties ['float'] ?? null;

But i don't know if this really fix the issue, because these warnings doesn't happens frequently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions