Update core/controller/legacy.php

changing place of
[code]$option = JFactory::getApplication()->input->get('option');[/code]
So the whole function can use the variable $option