From: Vincent Vanwaelscappel Date: Thu, 22 Aug 2024 15:51:40 +0000 (+0200) Subject: wait #7048 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d580b866861be5ec5d52596f9e2b5e95b3255067;p=fluidbook-toolbox.git wait #7048 @3 --- diff --git a/app/Models/ToolWebflow.php b/app/Models/ToolWebflow.php index 133f9d7a5..69f8102ba 100644 --- a/app/Models/ToolWebflow.php +++ b/app/Models/ToolWebflow.php @@ -533,7 +533,9 @@ class ToolWebflow extends ToolboxTranslatableModel // Texts foreach ($texts as $text => $translation) { - $html = str_replace('>' . $text . '<', '>' . $translation . '<', $html); + $pattern = '/>(\s*)(' . addcslashes($text, './()[]{}') . ')(\s*)${1}' . $translation . '${3}<', $html); } // Images diff --git a/app/Services/Webflow.php b/app/Services/Webflow.php index 5b1c4beb9..15c57f80b 100644 --- a/app/Services/Webflow.php +++ b/app/Services/Webflow.php @@ -382,8 +382,7 @@ class Webflow protected static function addTexts($texts, &$array) { foreach ($texts as $t) { - $t = trim($t); - if (!$t) { + if (!trim($t)) { continue; } $paragraphs = preg_split('/\v{2,}/', $t);