mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +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:
parent
6da53536ca
commit
d2e421c424
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user