Page MenuHomePhabricator

New hook right after initialization
Closed, ResolvedPublic

Description

Author: mati

Description:
Create an early hook "BeforeInitialize" in initialize() in Wiki.php.

I did the httpsExtension and ran across Bug #10719 ("SpecialPage hooks are broken"). My goal is to create a "SecurePages"-Extension where the administrator can easily define which pages should be hit via https (a similar extension is available for drupal). The Problem is that there is no good hook that

  • Is called on ALL pages (so you can actually check if I should redirect to https)
  • Is called relatively soon (so not to much work is done before being redirected to https)

I therefor propose to create a new "BeforeInitialize"-Hook that is called in initialize() in includes/Wiki.php. The attached patch (for 1.13.0) would create such a hook. I tested this on a test-wiki with a modified version of the httpsLogin extension and it works just fine.

I think this would also solve some of the problems in Bug #10719?


Version: 1.14.x
Severity: enhancement

Attached:

Details

Reference
bz15209

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:23 PM
bzimport set Reference to bz15209.

mati wrote:

Hi, Is there any reason there is still no comment on this report? I was hoping to get this into MediaWiki, or get it at least rejected, so I can maintain my own patch. Can somebody with authority give at least a comment?

Patch applied in r54318, also added Mediawiki object, figured that'd be helpful.