Fix #31197 for Joomla 2.5
Merge pull request #1966 from wilsonge/patch-3

Fix #31197 for Joomla 2.5