From 6c05f9ff428ba8522b061ed00628ecee4b1ebf90 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 12 Oct 2018 15:26:52 +0200 Subject: [PATCH] Sanitize (a bit) plugins directory --- pyrogram/client/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 0274e59f..31e6ef1b 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -239,8 +239,10 @@ class Client(Methods, BaseClient): else: log.warning(e) else: + plugins_dir = self.plugins_dir.lstrip("./").replace("/", ".") + for i in dirs: - module = import_module("{}.{}".format(self.plugins_dir, i.split(".")[0])) + module = import_module("{}.{}".format(plugins_dir, i.split(".")[0])) for j in dir(module): # noinspection PyBroadException