Summary of Changes
The 'current()' static method had to be changed as it returned the current request URI without the query parts or params. getInstance() does work for the situation.
Testing Instructions
Replace the static method in the codebase. Try editing any module and also set some parameters in dropdown menu's as well as in the text boxes. Now clicking on 'Back to top' link does not redirect to the home page as stated in the issue #9321 .
The tests broke due to some other commits. Should I make a new PR?