HomePhabricator

Improve/rename Parser::replaceUnusualEscapes

Description

Improve/rename Parser::replaceUnusualEscapes

The previous implementation would unescape '&', '=', '+', and '%'. The
first three will break the URL when unescaped in the query string, and
the last will break when unescaped anywhere.

The code is now changed to treat the path, query, and fragment parts of
the URL separately when unescaping. We also escape any unsafe characters
and ensure all percent-encodings use uppercase hexits.

And since the old name is no longer accurate,
Parser::replaceUnusualEscapes is deprecated in favor of
Parser::normalizeLinkUrl.

Bug: 57909
Change-Id: I77dc308d0d016c395ad737c08cf10a7711e25bbd

Details

Provenance
AnomieAuthored on
tstarlingCommitted on Sep 16 2014, 11:00 PM
Parents
rMW556b75985dc9: Merge "MovePage::move(): Return a Status object"
Branches
Unknown
Tags
Unknown
ChangeId
I77dc308d0d016c395ad737c08cf10a7711e25bbd