Changeset 30623


Ignore:
Timestamp:
Nov 27, 2014, 11:17:38 AM (9 years ago)
Author:
plg
Message:

bug fixed: makes sure we never return an array with a single empty value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMenuManager/amm_ajax.php

    r16006 r30623  
    372372    {
    373373      $link=$this->getLink($id);
    374       $link['accessUsers']=explode(',', $link['accessUsers']);
    375       $link['accessGroups']=explode(',', $link['accessGroups']);
     374     
     375      if (empty($link['accessUsers']))
     376      {
     377        $link['accessUsers'] = array();
     378      }
     379      else
     380      {
     381        $link['accessUsers']=explode(',', $link['accessUsers']);
     382      }
     383
     384      if (empty($link['accessGroups']))
     385      {
     386        $link['accessGroups'] = array();
     387      }
     388      else
     389      {
     390        $link['accessGroups']=explode(',', $link['accessGroups']);
     391      }
     392     
    376393      return(json_encode($link));
    377394    }
Note: See TracChangeset for help on using the changeset viewer.