work on Windows as well.
If your PHP is configured as a CGI plug-in rather than an Apache module you may
-experience problems, as this configuration is not well tested. safe_mode is also
-not tested and unlikely to work.
+experience problems, as this configuration is not well tested.
Support for rendering mathematical formulas requires installing the Math extension,
see https://www.mediawiki.org/wiki/Extension:Math
/**
* Additional email parameters, will be passed as the last argument to mail() call.
- * If using safe_mode this has no effect
*/
$wgAdditionalMailParams = null;
/**
* Check if wfShellExec() is effectively disabled via php.ini config
*
- * @return bool|string False or one of (safemode,disabled)
+ * @return bool|string False or 'disabled'
* @since 1.22
*/
function wfShellExecDisabled() {
static $disabled = null;
if ( is_null( $disabled ) ) {
- if ( wfIniGetBool( 'safe_mode' ) ) {
- wfDebug( "wfShellExec can't run in safe_mode, PHP's exec functions are too broken.\n" );
- $disabled = 'safemode';
- } elseif ( !function_exists( 'proc_open' ) ) {
+ if ( !function_exists( 'proc_open' ) ) {
wfDebug( "proc_open() is disabled\n" );
$disabled = 'disabled';
} else {
$disabled = wfShellExecDisabled();
if ( $disabled ) {
$retval = 1;
- return $disabled == 'safemode' ?
- 'Unable to run external programs in safe mode.' :
- 'Unable to run external programs, proc_open() is disabled.';
+ return 'Unable to run external programs, proc_open() is disabled.';
}
$includeStderr = isset( $options['duplicateStderr'] ) && $options['duplicateStderr'];
}
$done = true;
global $wgShellLocale;
- if ( !wfIniGetBool( 'safe_mode' ) ) {
- putenv( "LC_CTYPE=$wgShellLocale" );
- setlocale( LC_CTYPE, $wgShellLocale );
- }
+ putenv( "LC_CTYPE=$wgShellLocale" );
+ setlocale( LC_CTYPE, $wgShellLocale );
}
/**
MediaWiki\suppressWarnings();
if ( !curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
wfDebug( __METHOD__ . ": Couldn't set CURLOPT_FOLLOWLOCATION. " .
- "Probably safe_mode or open_basedir is set.\n" );
+ "Probably open_basedir is set.\n" );
// Continue the processing. If it were in curl_setopt_array,
// processing would have halted on its entry
}
}
if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
- if ( strval( ini_get( 'open_basedir' ) ) !== '' || wfIniGetBool( 'safe_mode' ) ) {
- wfDebug( "Cannot follow redirects in safe mode\n" );
+ if ( strval( ini_get( 'open_basedir' ) ) !== '' ) {
+ wfDebug( "Cannot follow redirects when open_basedir is set\n" );
return false;
}
}
'envCheckDB',
'envCheckBrokenXML',
'envCheckMbstring',
- 'envCheckSafeMode',
'envCheckXML',
'envCheckPCRE',
'envCheckMemory',
protected $internalDefaults = array(
'_UserLang' => 'en',
'_Environment' => false,
- '_SafeMode' => false,
'_RaiseMemory' => false,
'_UpgradeDone' => false,
'_InstallDone' => false,
return true;
}
- /**
- * Environment check for safe_mode.
- * @return bool
- */
- protected function envCheckSafeMode() {
- if ( wfIniGetBool( 'safe_mode' ) ) {
- $this->setVar( '_SafeMode', true );
- $this->showMessage( 'config-safe-mode' );
- }
-
- return true;
- }
-
/**
* Environment check for the XML module.
* @return bool
protected $values = array();
protected $groupPermissions = array();
protected $dbSettings = '';
- protected $safeMode = false;
protected $IP;
/**
}
$this->dbSettings = $db->getLocalSettings();
- $this->safeMode = $installer->getVar( '_SafeMode' );
$this->values['wgEmergencyContact'] = $this->values['wgPasswordSender'];
}
$locale = '';
}
- $hashedUploads = $this->safeMode ? '' : '#';
$metaNamespace = '';
if ( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) {
$metaNamespace = "\$wgMetaNamespace = \"{$this->values['wgMetaNamespace']}\";\n";
## available UTF-8 locale
{$locale}\$wgShellLocale = \"{$this->values['wgShellLocale']}\";
-## If you want to use image uploads under safe mode,
-## create the directories images/archive, images/thumb and
-## images/temp, and make them all writable. Then uncomment
-## this, if it's not already uncommented:
-{$hashedUploads}\$wgHashedUploadDirectory = false;
-
## Set \$wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
"config-outdated-sqlite": "<strong>Warning:</strong> you have SQLite $1, which is lower than minimum required version $2. SQLite will be unavailable.",
"config-no-fts3": "<strong>Warning:</strong> SQLite is compiled without the [//sqlite.org/fts3.html FTS3 module], search features will be unavailable on this backend.",
"config-mbstring": "<strong>Fatal: [http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload mbstring.func_overload] is active!</strong>\nThis option causes errors and may corrupt data unpredictably.\nYou cannot install or use MediaWiki unless this option is disabled.",
- "config-safe-mode": "<strong>Warning:</strong> PHP's [http://www.php.net/features.safe-mode safe mode] is active.\nIt may cause problems, particularly if using file uploads and <code>math</code> support.",
"config-xml-bad": "PHP's XML module is missing.\nMediaWiki requires functions in this module and will not work in this configuration.\nYou may need to install the php-xml RPM package.",
"config-pcre-old": "<strong>Fatal:</strong> PCRE $1 or later is required.\nYour PHP binary is linked with PCRE $2.\n[https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms/PCRE More information].",
"config-pcre-no-utf8": "<strong>Fatal:</strong> PHP's PCRE module seems to be compiled without PCRE_UTF8 support.\nMediaWiki requires UTF-8 support to function correctly.",
"config-outdated-sqlite": "Used as warning. Parameters:\n* $1 - the version of SQLite that has been installed\n* $2 - minimum version",
"config-no-fts3": "A \"[[:wikipedia:Front and back ends|backend]]\" is a system or component that ordinary users don't interact with directly and don't need to know about, and that is responsible for a distinct task or service - for example, a storage back-end is a generic system for storing data which other applications can use. Possible alternatives for back-end are \"system\" or \"service\", or (depending on context and language) even leave it untranslated.",
"config-mbstring": "{{Related|Config-fatal}}",
- "config-safe-mode": "Status message in the MediaWiki installer environment checks.",
"config-xml-bad": "Status message in the MediaWiki installer environment checks.",
"config-pcre-old": "Parameters:\n* $1 - minimum PCRE version number\n* $2 - the installed version of [[wikipedia:PCRE|PCRE]]\n{{Related|Config-fatal}}",
"config-pcre-no-utf8": "PCRE is a name of a programmers' library for supporting regular expressions. It can probably be translated without change.\n{{Related|Config-fatal}}",
set_error_handler( 'UserMailer::errorHandler' );
try {
- $safeMode = wfIniGetBool( 'safe_mode' );
-
foreach ( $to as $recip ) {
- if ( $safeMode ) {
- $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers );
- } else {
- $sent = mail(
- $recip,
- self::quotedPrintable( $subject ),
- $body,
- $headers,
- $extraParams
- );
- }
+ $sent = mail(
+ $recip,
+ self::quotedPrintable( $subject ),
+ $body,
+ $headers,
+ $extraParams
+ );
}
} catch ( Exception $e ) {
restore_error_handler();