Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Backport code audit from 1.2
Fixes issue with permissions checking
- Loading branch information
Showing
4 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,7 +190,7 @@ public function checkPersistCode($persistCode) | |
| return false; | ||
| } | ||
|
|
||
| return $persistCode == $this->persist_code; | ||
| return $persistCode === $this->persist_code; | ||
| } | ||
|
|
||
| // | ||
|
|
@@ -278,7 +278,7 @@ public function checkResetPasswordCode($resetCode) | |
| return false; | ||
| } | ||
|
|
||
| return ($this->reset_password_code == $resetCode); | ||
| return ($this->reset_password_code === $resetCode); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -386,7 +386,7 @@ public function removeGroup($group) | |
| public function inGroup($group) | ||
| { | ||
| foreach ($this->getGroups() as $_group) { | ||
| if ($_group->getKey() == $group->getKey()) { | ||
| if ($_group->getKey() === $group->getKey()) { | ||
| return true; | ||
| } | ||
| } | ||
|
|
@@ -481,7 +481,7 @@ public function hasPermission($permissions, $all = true) | |
|
|
||
| // We will make sure that the merged permission does not | ||
| // exactly match our permission, but starts with it. | ||
| if ($checkPermission != $mergedPermission && starts_with($mergedPermission, $checkPermission) && $value == 1) { | ||
| if ($checkPermission != $mergedPermission && starts_with($mergedPermission, $checkPermission) && $value === 1) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
daftspunk
Author
Member
|
||
| $matched = true; | ||
| break; | ||
| } | ||
|
|
@@ -496,7 +496,7 @@ public function hasPermission($permissions, $all = true) | |
|
|
||
| // We will make sure that the merged permission does not | ||
| // exactly match our permission, but ends with it. | ||
| if ($checkPermission != $mergedPermission && ends_with($mergedPermission, $checkPermission) && $value == 1) { | ||
| if ($checkPermission != $mergedPermission && ends_with($mergedPermission, $checkPermission) && $value === 1) { | ||
| $matched = true; | ||
| break; | ||
| } | ||
|
|
@@ -515,15 +515,15 @@ public function hasPermission($permissions, $all = true) | |
|
|
||
| // We will make sure that the merged permission does not | ||
| // exactly match our permission, but starts with it. | ||
| if ($checkMergedPermission != $permission && starts_with($permission, $checkMergedPermission) && $value == 1) { | ||
| if ($checkMergedPermission != $permission && starts_with($permission, $checkMergedPermission) && $value === 1) { | ||
| $matched = true; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| // Otherwise, we'll fallback to standard permissions checking where | ||
| // we match that permissions explicitly exist. | ||
| elseif ($permission == $mergedPermission && $mergedPermissions[$permission] == 1) { | ||
| elseif ($permission === $mergedPermission && $mergedPermissions[$permission] === 1) { | ||
| $matched = true; | ||
| break; | ||
| } | ||
|
|
||
apparently this
$valueis returning a string and not an integer. Any idea what it might be?