Page MenuHomePhabricator

Remove uses of Title::newFromURL
Open, LowPublic

Description

As per @TTO:

There are a few uses of Title::newFromURL left:

  • MediaWiki core includes/MediaWiki.php. This one is going to be very difficult to get rid of, as it is on the critical path for almost all index.php requests (it's used to convert the title= parameter into $wgTitle). There are subtle effects here that may result in URL breakages.
  • MediaWiki core includes/parser/CoreParserFunctions.php and Scribunto UrlLibrary. These seem to be used for handling user input (parameter to a parser function and a Lua function respectively) so are going to be more difficult to remove.
  • Something in FlaggedRevs
Usage

https://codesearch.wmflabs.org/search/?q=Title%3A%3AnewFromURL&i=nope&files=&repos=

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:08 AM
bzimport set Reference to bz63424.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to Daniel Norton from comment #0)

If that's accurate, then there's some code that needs fixing.

Would love to have some confirmation in this ticket from some core developers.

TTO subscribed.

I'll mentor this.

Most instances of this function, particularly in the special pages where the user input is coming out of getRequest()->getText(), can simply be replaced with Title::newFromText, but we will need to check them carefully.

Change 258524 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258536 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258537 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258538 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258594 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258613 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258625 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258627 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258628 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258629 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258630 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258632 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258636 had a related patch set uploaded (by Albert221):
Resolve code invoking Title::newFromURL

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

Change 258625 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258632 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258537 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258630 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258636 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258628 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258627 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258629 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258536 abandoned by Albert221:
Resolve code invoking Title::newFromURL

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

Change 258538 merged by jenkins-bot:
Replace Title::newFromURL with Title::newFromText

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

Change 258524 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

Change 258594 merged by jenkins-bot:
Resolve code invoking Title::newFromURL

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

As you can see, GCI student @Albert221 did an awesome amount of work to reduce uses of this function.

There are a few uses of Title::newFromURL left:

  • MediaWiki core includes/MediaWiki.php. This one is going to be very difficult to get rid of, as it is on the critical path for almost all index.php requests (it's used to convert the title= parameter into $wgTitle). There are subtle effects here that may result in URL breakages.
  • MediaWiki core includes/parser/CoreParserFunctions.php and Scribunto UrlLibrary. These seem to be used for handling user input (parameter to a parser function and a Lua function respectively) so are going to be more difficult to remove.
  • Something in FlaggedRevs that I couldn't understand.
TTO set Security to None.
TTO removed a subscriber: wikibugs-l-list.

Change 258613 abandoned by TTO:
Resolve code invoking Title::newFromURL

Reason:
Per Jack, I guess the best thing to do is to leave this repo alone for now.

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

Mvolz renamed this task from Resolve "wrong and broken code" that's invoking Title::newFromURL to Remove uses of Title::newFromURL.Oct 28 2016, 1:15 PM
Mvolz updated the task description. (Show Details)
Mvolz removed a project: Patch-For-Review.