Page MenuHomePhabricator

[ReplaceText] Add page number limit option
Closed, ResolvedPublic

Description

ReplaceText can be enhanced to accept an optional limit for the number of pages to return from the search, which would provide a way to resolve bug 38170 without needing to alter the server's PHP configuration. For example, today I tried running ReplaceText on 70000 pages, and it's only a matter of time before I'll try running it on millions of pages.

With a large enough replace operation, the incorrect namespace error is less of a problem than the page size and load time at the "are you sure?" verification stage of ReplaceText. That can render ReplaceText practically unusable even when using the server configuration workaround suggested in bug 38170.

The workaround I'm currently using is to enter all the possible page prefixes to ensure a predictable fraction of pages will be found and replaced. That works for 70,000 pages. It probably won't work anymore for millions of pages, simply because the fraction of pages will still be too large to produce a reasonably verification page size and load time.

This problem could also be helped with a "skip verification page" option, but given the power of ReplaceText, skipping the verification page is probably foolish.


Version: unspecified
Severity: critical
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=38170

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:10 AM
bzimport set Reference to bz43472.
bzimport added a subscriber: Unknown Object (MLST).

This turns out to be more important than just an enhancement, due to security issues and the potential for data to be lost, as described here:

https://bugzilla.wikimedia.org/show_bug.cgi?id=38170#c10

So, I'm elevating it to "critical" severity.

For anyone who finds these bug reports, I produced some more detailed documentation that describes the security issues and other known problems, and also provides descriptions of workarounds. It should be easier to read for people who aren't involved enough in MediaWiki extension development to feel comfortable divining solutions from bug reports.

https://www.mediawiki.org/wiki/User:Badon#Extension:ReplaceText_known_issues

Aklapper lowered the priority of this task from High to Medium.Apr 2 2015, 2:48 PM
Aklapper subscribed.
Yaron_Koren renamed this task from [ReplaceText] page limit option to circumvent server limitations that will inevitably cause the incorrect error: You must select at least one namespace to [ReplaceText] Add page number limit option.Jul 10 2023, 5:39 PM

Change 957824 had a related patch set uploaded (by TechieNK; author: TechieNK):

[mediawiki/extensions/ReplaceText@master] Add Page number limit option

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

Change 957824 merged by jenkins-bot:

[mediawiki/extensions/ReplaceText@master] Add Page number limit option

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

Yaron_Koren claimed this task.

A search limit is now available as a global setting, a UI field, and a script parameter, so I would say this task can be closed!