Implement https://github.com/joomla/joomla-cms/pull/3293
Fix test
Merge pull request #8 from wilsonge/patch-2

Implement CMS PR 3293