From 81e5d1c0251b1b3eec16a45175c570d7cb74836e Mon Sep 17 00:00:00 2001 From: Ilya Karavaev Date: Fri, 30 Oct 2020 21:34:23 +0300 Subject: [PATCH] Fix EMT_Base execute safe type --- EMT_Base.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/EMT_Base.php b/EMT_Base.php index 01f381c..9a02e67 100644 --- a/EMT_Base.php +++ b/EMT_Base.php @@ -213,14 +213,13 @@ public function safe_blocks($text, $way, $show = true) { if (count($this->_safe_blocks)) { - $safeType = true === $way ? "\\corpsepk\\yii2emt\\EMT_Lib::encrypt_tag(\$m[2])" : "stripslashes(\\corpsepk\\yii2emt\\EMT_Lib::decrypt_tag(\$m[2]))"; $safeblocks = true === $way ? $this->_safe_blocks : array_reverse($this->_safe_blocks); foreach ($safeblocks as $block) { $text = preg_replace_callback( "/({$block['open']})(.+?)({$block['close']})/s", - function ($m) use ($safeType) { - return $m[1].$safeType.$m[3]; + function ($m) use ($way) { + return $m[1].(true === $way ? EMT_Lib::encrypt_tag($m[2]) : stripslashes(EMT_Lib::decrypt_tag($m[2]))).$m[3]; }, $text );