From da2e7a2b4d55f74701b8b24c45e1c85751d8e1bd Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Mon, 4 Jun 2018 16:15:19 -0300 Subject: [PATCH] missing array key check --- src/classes/class-tainacan-capabilities.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/classes/class-tainacan-capabilities.php b/src/classes/class-tainacan-capabilities.php index 7fe656ca2..f9ae0dcd4 100644 --- a/src/classes/class-tainacan-capabilities.php +++ b/src/classes/class-tainacan-capabilities.php @@ -374,7 +374,11 @@ class Capabilities { if(! is_array($append_caps)) $append_caps = []; if( (! array_key_exists(self::$dependencies[$post_type][$cap], $append_caps) && $added ) || // we never added and need to add - ( $append_caps[self::$dependencies[$post_type][$cap]] === false && $added ) // we added but before is not need to add + ( + array_key_exists(self::$dependencies[$post_type][$cap], $append_caps) && + $append_caps[self::$dependencies[$post_type][$cap]] === false && + $added + ) // we added but before is not need to add ) { $append_caps[self::$dependencies[$post_type][$cap]] = 0; }