diff --git a/langs/en.json b/langs/en.json
index 7b6b778cd..8ccaa5932 100644
--- a/langs/en.json
+++ b/langs/en.json
@@ -150,5 +150,7 @@
"dl.php_powered_by_madelineproto": "Telegram file download server (up to 4GB), powered by MadelineProto!
Click here for more info on how to setup your very own Telegram file download server!",
- "account_banned": "!!!!!!! WARNING !!!!!!!\nTelegram's flood prevention system suspended this account.\nTo continue, manual verification is required.\nSend an email to recover@telegram.org, asking to unban the phone number %s, and shortly describe what will you do with this phone number.\nThen login again.\nIf you intentionally deleted this account, ignore this message."
+ "account_banned": "!!!!!!! WARNING !!!!!!!\nTelegram's flood prevention system suspended this account.\nTo continue, manual verification is required.\nSend an email to recover@telegram.org, asking to unban the phone number %s, and shortly describe what will you do with this phone number.\nThen login again.\nIf you intentionally deleted this account, ignore this message.",
+
+ "plugin_path_does_not_exist": "Plugin path %s does not exist!"
}
diff --git a/src/EventHandler.php b/src/EventHandler.php
index 1460a5dc7..b703a952f 100644
--- a/src/EventHandler.php
+++ b/src/EventHandler.php
@@ -379,7 +379,7 @@ abstract class EventHandler extends AbstractAPI
$pathNew = \realpath(\dirname((new ReflectionClass($class))->getFileName()).DIRECTORY_SEPARATOR.$path);
if ($pathNew === false) {
unset($paths[$k]);
- Logger::log("Plugin path $path does not exist!", Logger::FATAL_ERROR);
+ Logger::log(sprintf(Lang::$current_lang['plugin_path_does_not_exist'], $path), Logger::FATAL_ERROR);
continue;
}
}
@@ -399,10 +399,13 @@ abstract class EventHandler extends AbstractAPI
} elseif (isFile($file) && \str_ends_with($file, ".php")) {
$file = \realpath($file);
$fileName = \basename($file, '.php');
- if ($fileName === 'functions.php') {
+ if ($fileName === 'functions') {
require $file;
continue;
}
+ if (str_contains($fileName, '.')) {
+ continue;
+ }
$class = $namespace.'\\'.$fileName;
if (!\class_exists($class)) {
throw new AssertionError("$class was not defined when including $file!");