mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
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.
This commit is contained in:
@ -49,7 +49,7 @@ final class CommandStringHelper{
|
|||||||
foreach($matches[0] as $k => $_){
|
foreach($matches[0] as $k => $_){
|
||||||
for($i = 1; $i <= 2; ++$i){
|
for($i = 1; $i <= 2; ++$i){
|
||||||
if($matches[$i][$k] !== ""){
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user