Page MenuHomePhabricator

Special:NewPages does not handle RevisionDeletion
Closed, ResolvedPublic


Special:NewPages does not handle RevisionDeletion.

This means the hidden comment of a new created page is shown and the hidden user of a new created page is also shown.

Version: 1.18.x
Severity: major



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:36 PM
bzimport set Reference to bz27899.

Functional patch v1

A nice little patch to fix this. Slightly hackish, I suppose, but neat and functional nonetheless.

attachment SpecialNewpages.php ignored as obsolete

Functional patch v2

This one is actually the patch.

attachment 27899.patch ignored as obsolete

Bryan.TongMinh wrote:

I haven't looked in detail to the code, but I think you need to move the construction of the Revision object higher up so that you can also hide rc_user_text.

Also check whether the construction of a Revision object does cause an extra SQL query. Perhaps it is best to use Revision::selectFields() (not sure of the exact name) to get the required select fields.

Patch v3: Handle revdel'd usernames as well as comments


Oh, and no, Revision::construct() takes a database query result as a possible input (or an array, as here), it does not run its own, AFAICT.

That's what I'm using in the patch :)

Sorry, the diff is shown very small on my screen.

Maybe use ChangesList::isDeleted instead of creating a new Revision object.

Duplicatebug: That would be slightly more appropriate, agreed. However, since ChangesList isn't really set up for that, I think that may be the case of moving from one imperfect solution to another for only a slight gain.

Maybe the preferable option would be to extend the capabilities of the Linker to handle both RC and Revision objects passed to it, then take ChangesList and NewPages over to using that. Much neater :) What do you think?