1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 22:14:39 +01:00

Localize more errors

This commit is contained in:
Daniil Gentili 2023-07-18 16:11:27 +02:00
parent ca885a1bc5
commit d7a713971b
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 8 additions and 3 deletions

View File

@ -150,5 +150,7 @@
"dl.php_powered_by_madelineproto": "Telegram file download server (up to 4GB), powered by <a href=\"https://docs.madelineproto.xyz\" target=\"_blank\">MadelineProto</a>!<br>Click <a href=\"https://docs.madelineproto.xyz/docs/FILES.html#getting-a-download-link\" target=\"_blank\">here</a> for more info on how to setup your very own Telegram file download server!", "dl.php_powered_by_madelineproto": "Telegram file download server (up to 4GB), powered by <a href=\"https://docs.madelineproto.xyz\" target=\"_blank\">MadelineProto</a>!<br>Click <a href=\"https://docs.madelineproto.xyz/docs/FILES.html#getting-a-download-link\" target=\"_blank\">here</a> 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!"
} }

View File

@ -379,7 +379,7 @@ abstract class EventHandler extends AbstractAPI
$pathNew = \realpath(\dirname((new ReflectionClass($class))->getFileName()).DIRECTORY_SEPARATOR.$path); $pathNew = \realpath(\dirname((new ReflectionClass($class))->getFileName()).DIRECTORY_SEPARATOR.$path);
if ($pathNew === false) { if ($pathNew === false) {
unset($paths[$k]); 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; continue;
} }
} }
@ -399,10 +399,13 @@ abstract class EventHandler extends AbstractAPI
} elseif (isFile($file) && \str_ends_with($file, ".php")) { } elseif (isFile($file) && \str_ends_with($file, ".php")) {
$file = \realpath($file); $file = \realpath($file);
$fileName = \basename($file, '.php'); $fileName = \basename($file, '.php');
if ($fileName === 'functions.php') { if ($fileName === 'functions') {
require $file; require $file;
continue; continue;
} }
if (str_contains($fileName, '.')) {
continue;
}
$class = $namespace.'\\'.$fileName; $class = $namespace.'\\'.$fileName;
if (!\class_exists($class)) { if (!\class_exists($class)) {
throw new AssertionError("$class was not defined when including $file!"); throw new AssertionError("$class was not defined when including $file!");