Page MenuHomePhabricator

Article::doEdit() can have fatal side effect
Closed, ResolvedPublic

Description

Sometimes the wrong article is edited, because Article::doEdit() has side effect. I tracked it down doEdit > prepareTextForEdit > getContent -> loadContent which calls getOldID() which calls request parameters, and after that calls fetchContent which updates mTitle.

This is seen at least in 1.16.0, probably happens in trunk too.


Version: 1.16.x
Severity: major

Details

Reference
bz24997

Event Timeline

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

Translate extension is using the jobqueue to update articles. They construct their own article object and call doEdit on it.

The real issue here is the fact that Article::getOldID() accesses the request parameters (evil) and allows them to override mTitle (very evil).

Nope, it's just one caller which was hit by this bug.

Looks like this has been resolved. Nothing is calling Article::loadContent (deprecated in favor of Article::fetchContent (deprecated in favor of Article::fetchContentObject))