Switch custom code to wfParseUrl which covers the same bugfix

Change-Id: I60b20bd7e8f4b25acd5ef2de172786a152c0e589
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/301
Merge "Switch custom code to wfParseUrl which covers the same bugfix"