* (bug 30160) Add public method to mw.loader to get module names from registry.
* (bug 15558) Parameters to special pages included in wikitext can now be passed
as with templates.
+* Installer now issues a warning if mod_security is present.
=== Bug fixes in 1.19 ===
* $wgUploadNavigationUrl should be used for file redlinks if
'config-wincache' => '[http://www.iis.net/download/WinCacheForPhp WinCache] is installed',
'config-no-cache' => "'''Warning:''' Could not find [http://eaccelerator.sourceforge.net eAccelerator], [http://www.php.net/apc APC], [http://trac.lighttpd.net/xcache/ XCache] or [http://www.iis.net/download/WinCacheForPhp WinCache].
Object caching is not enabled.",
+ 'config-mod-security' => "'''Warning''': your web server has [http://modsecurity.org/ mod_security] enabled. If misconfigured, it can cause problems for MediaWiki or other software that allows users to post arbitrary content.
+Refer to [http://modsecurity.org/documentation/ mod_security documentation] or contact your host's support if you encounter random errors.",
'config-diff3-bad' => 'GNU diff3 not found.',
'config-imagemagick' => 'Found ImageMagick: <code>$1</code>.
Image thumbnailing will be enabled if you enable uploads.',
'envCheckPCRE',
'envCheckMemory',
'envCheckCache',
+ 'envCheckModSecurity',
'envCheckDiff3',
'envCheckGraphics',
'envCheckServer',
$this->setVar( '_Caches', $caches );
}
+ /**
+ * Scare user to death if they have mod_security
+ */
+ protected function envCheckModSecurity() {
+ if ( !self::apacheModulePresent( 'mod_security' ) ) {
+ $this->showMessage( 'config-mod-security' );
+ }
+ }
+
/**
* Search for GNU diff3.
*/
return false;
}
+ /**
+ * Checks for presence of an Apache module. Works only if PHP is running as an Apache module, too.
+ *
+ * @param $moduleName String: Name of module to check.
+ * @return bool
+ */
+ public static function apacheModulePresent( $moduleName ) {
+ if ( function_exists( 'apache_get_modules' ) && in_array( $moduleName, apache_get_modules() ) ) {
+ return true;
+ }
+ // try it the hard way
+ ob_start();
+ phpinfo( INFO_MODULES );
+ $info = ob_get_clean();
+ return strpos( $info, $moduleName ) !== false;
+ }
+
/**
* ParserOptions are constructed before we determined the language, so fix it
*