Correct API key regex.

parent cf209dcf
...@@ -143,7 +143,7 @@ class Telegram ...@@ -143,7 +143,7 @@ class Telegram
if (empty($api_key)) { if (empty($api_key)) {
throw new TelegramException('API KEY not defined!'); throw new TelegramException('API KEY not defined!');
} }
preg_match('/(\d+)\:.+/', $api_key, $matches); preg_match('/(\d+)\:[\w\-]+/', $api_key, $matches);
if (!isset($matches[1])) { if (!isset($matches[1])) {
throw new TelegramException('Invalid API KEY defined!'); throw new TelegramException('Invalid API KEY defined!');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment