Port joomla/joomla-platform#1831