Page MenuHomePhabricator

Remove deprecated $wgFilterCallback from core
Closed, ResolvedPublic


$wgFilterCallback should be removed entirely since it duplicates the EditFilter hook. It was added before the hook system existed and has the problem that it can only have one function. No extension use it except to duplicate EditPage::internalAttemptSave() code, so it can be safely removed.

Version: unspecified
Severity: trivial



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:55 PM
bzimport set Reference to bz30410.
IAlex created this task.Aug 16 2011, 8:34 PM

Setting milestone for 1.20, low priority but should happen in the next version trunk;

Adding keyword 'easy'. I think it's easy, if someone feels like doing it before 1.20 that's fine too.

The setting is deprecated since 1.17 (r87584 / r67733)

Created attachment 10069
Removal of deprecated $wgFilterCallback

Hashar emailed me about a page (Annoying little bugs) linking to a query for easy bugs, and I found this one.

Am I doing this right? (see patch)

attachment MWFilterCallbackRemoval.patch ignored as obsolete

You're doing this right. I'll get Hashar to review your patch.

Assigning bug to me since I will be reviewing this patch :-]

saper added a comment.Mar 16 2012, 5:32 PM

The patch seems fine.

Still some extensions (maybe old) refer to it:

./trunk/extensions/Configure/scripts/findSettings.php: 'wgFilterCallback', // Needs PHP code
./trunk/extensions/Form/Form.body.php: global $wgSpamRegex, $wgFilterCallback, $wgUser, $wgMaxArticleSize, $wgOut;
./trunk/extensions/Form/Form.body.php: } elseif ( $wgFilterCallback && $wgFilterCallback( $nt, $text, 0 ) ) {
./trunk/extensions/Postcomment/Postcomment.php: global $wgFilterCallback, $wgWhitelistEdit;
./trunk/extensions/Postcomment/Postcomment.php: if ( $wgFilterCallback && $wgFilterCallback( $t, $text, $tmp) ) {
./trunk/extensions/MirrorTools/MirrorTools.classes.php: global $wgFilterCallback, $wgUser, $wgOut, $wgParser;
./trunk/extensions/MirrorTools/MirrorTools.classes.php: if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, $this->hookError, $this->summary ) ) {

What's interesting they are rather invoking it (not setting a filter).

A RELEASE NOTES entry would be nice as well.

Created attachment 10261
Removal of deprecated $wgFilterCallback

This, like the last patch, also removes the API 'filtered' error and EditPage::AS_FILTERING. This time it should fix extensions as well.