From 433c50c8bf373e18c994c49e3c18d456f8c3a6ff Mon Sep 17 00:00:00 2001 From: markseu Date: Sun, 2 Aug 2020 15:22:11 +0200 Subject: [PATCH] Updated extensions for new API, thanks Steffen --- system/extensions/core.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/system/extensions/core.php b/system/extensions/core.php index 09faeea..f6515d3 100644 --- a/system/extensions/core.php +++ b/system/extensions/core.php @@ -26,8 +26,8 @@ class YellowCore { $this->extension = new YellowExtension($this); $this->lookup = new YellowLookup($this); $this->toolbox = new YellowToolbox(); - $this->text = new YellowText($this); - $this->extensions = new YellowExtensions($this); + $this->text = new YellowText($this); // TODO: remove later, for backwards compatibility + $this->extensions = new YellowExtensions($this); // TODO: remove later, for backwards compatibility $this->system->setDefault("sitename", "Yellow"); $this->system->setDefault("author", "Yellow"); $this->system->setDefault("email", "webmaster"); @@ -3107,18 +3107,19 @@ class YellowToolbox { if (preg_match("/^(\xEF\xBB\xBF)?\-\-\-[\r\n]+(.+?)\-\-\-[\r\n]+(.*)$/s", $rawData, $parts)) { $found = false; $key = lcfirst($key); + $rawDataMiddle = ""; foreach ($this->getTextLines($parts[2]) as $line) { if (preg_match("/^\s*(.*?)\s*:\s*(.*?)\s*$/", $line, $matches)) { if (lcfirst($matches[1])==$key) { - $rawDataNew .= "$matches[1]: $value\n"; + $rawDataMiddle .= "$matches[1]: $value\n"; $found = true; continue; } } - $rawDataNew .= $line; + $rawDataMiddle .= $line; } - if (!$found) $rawDataNew .= ucfirst($key).": $value\n"; - $rawDataNew = $parts[1]."---\n".$rawDataNew."---\n".$parts[3]; + if (!$found) $rawDataMiddle .= ucfirst($key).": $value\n"; + $rawDataNew = $parts[1]."---\n".$rawDataMiddle."---\n".$parts[3]; } else { $rawDataNew = $rawData; }