projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90d9e73
)
WordPress: avoid PHP notice if the anonymous user does not have any capabilities
author
Mathieu Lutfy
<mathieu@symbiotic.coop>
Thu, 4 Mar 2021 21:34:33 +0000
(16:34 -0500)
committer
Mathieu Lutfy
<mathieu@bidon.ca>
Thu, 4 Mar 2021 21:49:01 +0000
(16:49 -0500)
CRM/Core/Permission/WordPress.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/Permission/WordPress.php
b/CRM/Core/Permission/WordPress.php
index 3325d0fc117c3f23a4ba3dee0e04cf42b6f4ff6f..03eeb9be3b0fa7c7be72ed61bdb036082ef2ac82 100644
(file)
--- a/
CRM/Core/Permission/WordPress.php
+++ b/
CRM/Core/Permission/WordPress.php
@@
-76,10
+76,8
@@
class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base {
else {
//check the capabilities of Anonymous user)
$roleObj = new WP_Roles();
- if (
- $roleObj->get_role('anonymous_user') != NULL &&
- array_key_exists($str, $roleObj->get_role('anonymous_user')->capabilities)
- ) {
+ $anonObj = $roleObj->get_role('anonymous_user');
+ if (!empty($anonObj->capabilities) && array_key_exists($str, $anonObj->capabilities)) {
return TRUE;
}
}