Skip to content

Commit

Permalink
corrections for PHP 8.1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ternite committed Feb 23, 2023
1 parent 1600b3d commit 3d39435
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 5 additions & 1 deletion ODT/styles/ODTStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ abstract public function setProperty($property, $value);
* @return string The current value of the property
*/
public function getProperty($property) {
return $this->properties [$property]['value'];
if (array_key_exists($property,$this->properties)) {
return $this->properties [$property]['value'];
} else {
return NULL;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ODT/styleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function addStyleInternal(&$dest, &$dest_by_name, ODTStyle $new, $overwri
// The key for a normal style is the name.
$name = $new->getProperty('style-name');

if ($dest_by_name [$name] == NULL) {
if (!array_key_exists($name,$dest_by_name) || $dest_by_name [$name] == NULL) {
$dest [] = $new;
if (!empty($name)) {
$dest_by_name [$name] = $new;
Expand Down
14 changes: 9 additions & 5 deletions helper/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,10 @@ protected function loadIntern(&$warning, $refresh) {

// Check DokuWiki global configuration.
$dw_name = $this->hasDWGlobalSetting ($name);
if (!$value && $conf[$dw_name]) {
$this->setParam ($name, $conf[$dw_name]);
if (!is_null($dw_name) and !is_null($conf)) {
if (!$value && array_key_exists($dw_name,$conf)) {
$this->setParam ($name, $conf[$dw_name]);
}
}

// Check plugin configuration.
Expand All @@ -584,9 +586,11 @@ protected function loadIntern(&$warning, $refresh) {

// Check meta data in case syntax tags have written
// the config parameters to it.
$value = $odt_meta[$name];
if($this->isMetaSetting($name) && !empty($value)) {
$this->setParam ($name, $value);
if (!is_null($odt_meta) and !is_null($name)) {
$value = $odt_meta[$name];
if($this->isMetaSetting($name) && !empty($value)) {
$this->setParam ($name, $value);
}
}

// ODT-Template based export required?
Expand Down

0 comments on commit 3d39435

Please sign in to comment.