From 81b6c4485d88588a03ba03439be10746453aa511 Mon Sep 17 00:00:00 2001 From: nerun Date: Tue, 28 Nov 2023 11:19:54 -0300 Subject: [PATCH] Fix issue #272: PHP 8+ warnings, "undefined array key", margins lines 671-4 and 695. --- helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helper.php b/helper.php index 6fc2cc5..8c38a2a 100644 --- a/helper.php +++ b/helper.php @@ -668,10 +668,10 @@ function renderODTOpenTable ($renderer, $attr, $style, $attr_string) { $background_color = $css_properties ['background-color']; $image = $css_properties ['background-image'] ?? null; - $margin_top = $css_properties ['margin-top']; - $margin_right = $css_properties ['margin-right']; - $margin_bottom = $css_properties ['margin-bottom']; - $margin_left = $css_properties ['margin-left']; + $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; $width = $attr ['width']; // Open 2x1 table if image is present @@ -692,7 +692,7 @@ function renderODTOpenTable ($renderer, $attr, $style, $attr_string) { } $frame_props ['min-height'] = '1cm'; $frame_props ['width'] = $attr ['width']; - $frame_props ['float'] = $css_properties ['float']; + $frame_props ['float'] = $css_properties ['float'] ?? null; if ( self::$table_entr > 1 ) { $frame_props ['anchor-type'] = 'as-char'; } else {