I've had to correct this for 4.2 LTS - apparently $relTypeDir[$dir] is of type Array now.
Merge pull request #1561 from cividesk/Membership-fix

Fix regression on membership