Page MenuHomePhabricator

SpecialPage::exists should normalize input
Closed, ResolvedPublic

Description

Normalize input in exists

The input of SpecialPage::exists is not normalized, so special pages with spaces are not marked as exists.

This affected (at least) the special page normalizing of the api (bug 24185)

Thanks.

See also bug 25713


Version: 1.17.x
Severity: enhancement

Attached:

Details

Reference
bz25878

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:17 PM
bzimport set Reference to bz25878.
bzimport added a subscriber: Unknown Object (MLST).

Maybe resolveAliasWithSubpage is better as resolveAlias in this case ...

The patch doesn't strip Special page name parameters, and resolveAlias only officially deals with aliases, it does not guarantee that the "plain" form is tested. I'll just add space normalization to exists instead.

hmm, this problem is wider however. The name of Special pages is nowhere enforced to use the dbkey form. Perhaps we should fix uses of SpecialPage:exists instead ?

(In reply to comment #2)

The patch doesn't strip Special page name parameters, and resolveAlias only
officially deals with aliases, it does not guarantee that the "plain" form is
tested. I'll just add space normalization to exists instead.

Should work to run the string through self::resolveAliasWithSubpage(), then check the first element of the returned array.

sumanah wrote:

Umherirrender, thanks for the patch. You've received code review in the last few comments; are you interested in updating your patch to deal with those issues? Thanks again.

Looks fixed after r86255, because that rev adds the call to resolveAlias. resolveAlias handles the space problem correct.

Marking as FIXED.