missing array key check

This commit is contained in:
Jacson Passold 2018-06-04 16:15:19 -03:00
parent 873d1aac83
commit da2e7a2b4d
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}