Patch 2

Same as https://github.com/joomla/joomla-cms/pull/720 but for Joomla 2.5