Fixed InputHandler

Restoring support for upload.wikimedia.org subdomain which was dropped by change da3fd00ebb46a4615371db60adc8028ee34aa513.