From 726c5652f7ae26bde54f6e59b33888a391fa298e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 24 Nov 2021 17:07:34 +0000 Subject: [PATCH] ScriptPluginLoader: fixed reading @tags from non-docblock lines preceding the first docblock --- src/pocketmine/plugin/ScriptPluginLoader.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/plugin/ScriptPluginLoader.php b/src/pocketmine/plugin/ScriptPluginLoader.php index ea9d4c22d..5f8b083bf 100644 --- a/src/pocketmine/plugin/ScriptPluginLoader.php +++ b/src/pocketmine/plugin/ScriptPluginLoader.php @@ -64,8 +64,12 @@ class ScriptPluginLoader implements PluginLoader{ $insideHeader = false; foreach($content as $line){ - if(!$insideHeader and strpos($line, "/**") !== false){ - $insideHeader = true; + if(!$insideHeader){ + if(strpos($line, "/**") !== false){ + $insideHeader = true; + }else{ + continue; + } } if(preg_match("/^[ \t]+\\*[ \t]+@([a-zA-Z]+)([ \t]+(.*))?$/", $line, $matches) > 0){ @@ -79,7 +83,7 @@ class ScriptPluginLoader implements PluginLoader{ $data[$key] = $content; } - if($insideHeader and strpos($line, "*/") !== false){ + if(strpos($line, "*/") !== false){ break; } }