List of steps to reproduce
- Install MediaWiki 1.35 and AccessControl 4.1.
- Use the <accesscontrol> tag or an AccessControl template
- Protect a page from anonymous users
- Access this page as an anonymous user
What happens?
- AccessControl redirect anonymous users to /index.php/MySitename:Deny_user
- The server respond with a 404 Not Found HTTP status (because index.php is not handled in the nginx configuration)
What should have happened instead?:
- AccessControl should redirect to /wiki/MyMetaNamespace:Deny_user as the $wgArticlePath is set to /wiki/$1 and $wgMetaNamespace is made for this usage
Solution
In AccessControl.hooks.php, at line 760:
replace $wgScript . "/" . $wgSitename . ":" . wfMessage( $info )->text()
with str_replace( '$1', $wgMetaNamespace . ":" . wfMessage( $info )->text(), $wgArticlePath)
Software version
Product | Version |
---|---|
MediaWiki | 1.35.6 |
PHP | 7.3.33 (fpm-fcgi) |
MariaDB | 10.3.32 |
ICU | 65.1 |
Lua | 5.1.5 |
Extension | Version |
AccessControl | 4.1 |