Commit 5aba5f766cad48b884445d1a78fc749c335368a6

Authored by nbm
1 parent b98235f2

Don't use array_intersect against just one array, just use the array

directly.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4967 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/permissions/permissionlookupassignment.inc.php
@@ -79,7 +79,13 @@ class KTPermissionLookupAssignment extends KTEntity { @@ -79,7 +79,13 @@ class KTPermissionLookupAssignment extends KTEntity {
79 } 79 }
80 $aOptions[] = $aThisOptions; 80 $aOptions[] = $aThisOptions;
81 } 81 }
82 - $aPLIDs = call_user_func_array('array_intersect', $aOptions); 82 + if (count($aOptions) > 1) {
  83 + $aPLIDs = call_user_func_array('array_intersect', $aOptions);
  84 + } elseif (count($aOptions) == 1) {
  85 + $aPLIDs = $aOptions[0];
  86 + } else {
  87 + $aPLIDs = array();
  88 + }
83 if (empty($aPLIDs)) { 89 if (empty($aPLIDs)) {
84 $oPL = KTPermissionLookup::createFromArray(array()); 90 $oPL = KTPermissionLookup::createFromArray(array());
85 $iPLID = $oPL->getID(); 91 $iPLID = $oPL->getID();