Commit 5aba5f766cad48b884445d1a78fc749c335368a6
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
Showing
1 changed file
with
7 additions
and
1 deletions
lib/permissions/permissionlookupassignment.inc.php
| ... | ... | @@ -79,7 +79,13 @@ class KTPermissionLookupAssignment extends KTEntity { |
| 79 | 79 | } |
| 80 | 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 | 89 | if (empty($aPLIDs)) { |
| 84 | 90 | $oPL = KTPermissionLookup::createFromArray(array()); |
| 85 | 91 | $iPLID = $oPL->getID(); | ... | ... |