also protect my ns

This commit is contained in:
Jean-Christian Paul Denis 2023-04-20 16:54:14 +02:00
parent 7b35576cec
commit 32be05ad70
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -86,7 +86,7 @@ class Cleaners
if (!isset($this->cleaners[$id])) { if (!isset($this->cleaners[$id])) {
throw new Exception(sprintf(__('Unknown cleaner "%s"'), $id)); throw new Exception(sprintf(__('Unknown cleaner "%s"'), $id));
} }
if ($ns == My::root()) { if (in_array($ns, [My::id(), My::root()]) {
throw new Exception(__("Unsintaller can't remove itself")); throw new Exception(__("Unsintaller can't remove itself"));
} }