From 227a2a35d64db87d889f7a44101f11a117b8e06a Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 18 Jan 2020 16:35:20 +0100 Subject: refactoring medialist --- app/class/Modelrender.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/class/Modelrender.php') diff --git a/app/class/Modelrender.php b/app/class/Modelrender.php index 778b327..593a420 100644 --- a/app/class/Modelrender.php +++ b/app/class/Modelrender.php @@ -437,16 +437,17 @@ class Modelrender extends Modelpage */ public function automedialist(string $text) { - preg_match_all('~\%MEDIA\?([a-zA-Z0-9\&=\-\/\%]*)\%~', $text, $out); + preg_match_all('~\%MEDIA\?([a-zA-Z0-9\[\]\&=\-\/\%]*)\%~', $text, $out); foreach ($out[0] as $key => $match) { - $matches[$key] = ['fullmatch' => $match, 'options' => $out[1][$key]]; + $matches[$key] = ['fullmatch' => $match, 'filter' => $out[1][$key]]; } if(isset($matches)) { foreach ($matches as $match) { $medialist = new Medialist($match); - $text = str_replace($medialist->fullmatch(), $medialist->content(), $text); + $medialist->readfilter(); + $text = str_replace($medialist->fullmatch(), $medialist->generatecontent(), $text); } } return $text; -- cgit v1.2.3