Use parse_ini_file instead of home-grown solution (#366)

* Use parse_ini_file instead of home-grown solution

* Updated PocketMine-Language submodule
This commit is contained in:
Dylan K. Taylor 2017-02-19 15:53:22 +00:00 committed by GitHub
parent 834dc343b0
commit 89216c3bd4
2 changed files with 2 additions and 23 deletions

View File

@ -82,28 +82,7 @@ class BaseLang{
protected static function loadLang($path, array &$d){
if(file_exists($path)){
if(strlen($content = file_get_contents($path)) > 0){
foreach(explode("\n", $content) as $line){
$line = trim($line);
if($line === "" or $line{0} === "#"){
continue;
}
$t = explode("=", $line, 2);
if(count($t) < 2){
continue;
}
$key = trim($t[0]);
$value = trim($t[1]);
if($value === ""){
continue;
}
$d[$key] = $value;
}
}
$d = parse_ini_file($path, false, INI_SCANNER_RAW);
return true;
}else{
return false;

@ -1 +1 @@
Subproject commit 24b5e323c440144561111d3843a5a59e8e21f973
Subproject commit 3499fe4a6a1973cc965396f184eb01c52de79aa4