From d2e421c424ea539813f09d48e73681ceafdd24fd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 10 May 2022 15:09:57 +0100 Subject: [PATCH] CommandStringHelper: fixed backslashes not being removed from escaped quotes this time, without breaking eval commands ... stripslashes likes to strip ALL backslashes, whether they are actually escaping something or not, which is super annoying. --- src/command/utils/CommandStringHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/utils/CommandStringHelper.php b/src/command/utils/CommandStringHelper.php index 8c675cea9..3f24aef37 100644 --- a/src/command/utils/CommandStringHelper.php +++ b/src/command/utils/CommandStringHelper.php @@ -49,7 +49,7 @@ final class CommandStringHelper{ foreach($matches[0] as $k => $_){ for($i = 1; $i <= 2; ++$i){ if($matches[$i][$k] !== ""){ - $args[(int) $k] = $i === 1 ? stripslashes($matches[$i][$k]) : $matches[$i][$k]; + $args[(int) $k] = preg_replace('/\\\\([\\\\"])/u', '$1', $matches[$i][$k]); break; } }