From f1cab91ac94795a42d098a3a6da14bd982b26cf2 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 8 Jul 2018 11:50:17 +0100 Subject: [PATCH 1/2] Config: fixed interpreting invalid keys as empty strings these should just be ignored completely. --- src/pocketmine/utils/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/utils/Config.php b/src/pocketmine/utils/Config.php index 37fad1418..7718b0f5f 100644 --- a/src/pocketmine/utils/Config.php +++ b/src/pocketmine/utils/Config.php @@ -550,7 +550,7 @@ class Config{ * @param string $content */ private function parseProperties(string $content){ - if(preg_match_all('/([a-zA-Z0-9\-_\.]*)=([^\r\n]*)/u', $content, $matches) > 0){ //false or 0 matches + if(preg_match_all('/([a-zA-Z0-9\-_\.]+)=([^\r\n]*)/u', $content, $matches) > 0){ //false or 0 matches foreach($matches[1] as $i => $k){ $v = trim($matches[2][$i]); switch(strtolower($v)){ From 7ee98ff139e23a618f33c14d329ca68b90855be4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 8 Jul 2018 11:54:06 +0100 Subject: [PATCH 2/2] Config: fixed whitespace between key and = being invalid it tolerates whitespace everywhere except here already ^.^ --- src/pocketmine/utils/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/utils/Config.php b/src/pocketmine/utils/Config.php index 7718b0f5f..c8609afdc 100644 --- a/src/pocketmine/utils/Config.php +++ b/src/pocketmine/utils/Config.php @@ -550,7 +550,7 @@ class Config{ * @param string $content */ private function parseProperties(string $content){ - if(preg_match_all('/([a-zA-Z0-9\-_\.]+)=([^\r\n]*)/u', $content, $matches) > 0){ //false or 0 matches + if(preg_match_all('/([a-zA-Z0-9\-_\.]+)[ \t]*=([^\r\n]*)/u', $content, $matches) > 0){ //false or 0 matches foreach($matches[1] as $i => $k){ $v = trim($matches[2][$i]); switch(strtolower($v)){