Revert "lib: Reduce else { if { to elseif { in User::can()"

This reverts commit e5b0b52874.
This commit is contained in:
Eric Lippmann 2015-02-02 13:41:02 +01:00
parent 5a1ebf9c89
commit 9ac9342107
1 changed files with 7 additions and 5 deletions

View File

@ -426,11 +426,13 @@ class User
foreach ($this->permissions as $permitted) {
$wildcard = strpos($permitted, '*');
if ($wildcard !== false) {
}
if (substr($permission, 0, $wildcard) === substr($permitted, 0, $wildcard)) {
return true;
} elseif ($permission === $permitted) {
return true;
if (substr($permission, 0, $wildcard) === substr($permitted, 0, $wildcard)) {
return true;
} else {
if ($permission === $permitted) {
return true;
}
}
}
}
return false;