Fixing joomla/joomla-platform#1279
Merge pull request #1849 from joomla/JRegistrySetFix

Fixing joomla/joomla-platform#1279