Fix PHP errors relating to using string offset as an array

Fixes #2795 and #2796 on the pfSense bug tracker