Rename mw.util.wikiGetlink to mw.util.getUrl
Closed, ResolvedPublic

Description

The fact the function name is not camel case is confusing (the l is actually lowercase).

Might I suggest we make it a more meaningful name e.g. mw.util.getUrl and support this name in a legacy JavaScript file?


Version: 1.19
Severity: enhancement

Details

Reference
bz55764
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz55764.

Agree, wikiGetlink is misleading (and should be camel case anyway).

True. Let's mw.log.deprecate() it and use a saner name (getUrl looks okay, getPageUrl might be okay too).

Change 90569 had a related patch set uploaded by Bartosz Dziewoński:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/90569

What about changing also:

  • mw.util.rawurlencode -> mw.util.rawUrlEncode
  • mw.util.wikiUrlencode -> mw.util.wikiUrlEncode

?

(In reply to comment #4)

  • mw.util.rawurlencode -> mw.util.rawUrlEncode
  • mw.util.wikiUrlencode -> mw.util.wikiUrlEncode

rawurlencode() and urlencode() are functions in PHP, and these are PHP-isms.
We might want to rename them to something more JavaScriptey (related function in JS is called encodeURIComponent()).

Change 90569 merged by jenkins-bot:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/90569

Change 94270 had a related patch set uploaded by Krinkle:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/94270

Change 94271 had a related patch set uploaded by Krinkle:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/94271

Change 94270 merged by jenkins-bot:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/94270

Change 94271 merged by jenkins-bot:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/94271

Change 95474 had a related patch set uploaded by Catrope:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/95474

Backported to 1.22

Change 95474 merged by jenkins-bot:
Rename mw.util.wikiGetlink to getUrl

https://gerrit.wikimedia.org/r/95474

Add Comment