Removing unused call to $wgContLang->getFormattedNsText() from addNewUserLogEntry()
* Useful if you want to use a shared repository by default
* without disabling local uploads (use $wgEnableUploads = false for that)
* e.g. $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';
- *
+ *
* This also affects images inline images that do not exist. In that case the URL will get
* (?|&)wpDestFile=<filename> appended to it as appropriate.
*/
*/
$wgLBFactoryConf = array( 'class' => 'LBFactory_Simple' );
-/**
- * Unique identifier if you're paranoid and don't want $wgDBname as part of
+/**
+ * Unique identifier if you're paranoid and don't want $wgDBname as part of
* wfWikiId(). See bug 21086
*/
$wgWikiId = false;
$wgOutputEncoding = 'UTF-8';
$wgEditEncoding = '';
-/**
- * Set this to true to clean up archaic Unicode sequences in Arabic and
+/**
+ * Set this to true to clean up archaic Unicode sequences in Arabic and
* Malayalam text. Currently only works if $wgLanguageCode is set to Arabic
* or Malayalam.
*
- * Enabling this is generally a good idea for new wikis, since it fixes a few
- * technical problems to do with editing these languages. However, if it's
- * enabled on an existing wiki, pages which contain the problematic characters
+ * Enabling this is generally a good idea for new wikis, since it fixes a few
+ * technical problems to do with editing these languages. However, if it's
+ * enabled on an existing wiki, pages which contain the problematic characters
* in their page titles may become inaccessible. Running maintenance/cleanupTitles.php
* after enabling it may fix this.
*/
$wgHtml5Version = null;
/**
- * Enabled RDFa attributes for use in wikitext.
+ * Enabled RDFa attributes for use in wikitext.
* NOTE: Interaction with HTML5 is somewhat underspecified.
*/
$wgAllowRdfaAttributes = true;
* Like $wgArticlePath, but on multi-variant wikis, this provides a
* path format that describes which parts of the URL contain the
* language variant. For Example:
- *
+ *
* $wgLanguageCode = 'sr';
* $wgVariantArticlePath = '/$2/$1';
* $wgArticlePath = '/wiki/$1';
- *
+ *
* A link to /wiki/ would be redirected to /sr/Главна_страна
*
* It is important that $wgArticlePath not overlap with possible values
* of $wgVariantArticlePath.
*/
-$wgVariantArticlePath = false;///< defaults to false
+$wgVariantArticlePath = false;///< defaults to false
/**
* Show a bar of language selection links in the user login and user
$wgUseTeX = false;
/** Location of the texvc binary */
$wgTexvc = './math/texvc';
-/**
- * Texvc background color
+/**
+ * Texvc background color
* use LaTeX color format as used in \special function
* for transparent background use value 'Transparent' for alpha transparency or
* 'transparent' for binary transparency.
$mBlockreason, $mBlock, $mEffectiveGroups, $mBlockedGlobally,
$mLocked, $mHideName, $mOptions;
//@}
-
+
static $idCacheByName = array();
/**
*/
function getPasswordValidity( $password ) {
global $wgMinimalPasswordLength, $wgContLang;
-
+
$result = false; //init $result to false for the internal checks
-
+
if( !wfRunHooks( 'isValidPassword', array( $password, &$result, $this ) ) )
return $result;
-
+
if ( $result === false ) {
if( strlen( $password ) < $wgMinimalPasswordLength ) {
return 'passwordtooshort';
$defOpt['searchNs'.$nsnum] = !empty( $wgNamespacesToBeSearchedDefault[$nsnum] );
}
$defOpt['skin'] = $wgDefaultSkin;
-
+
return $defOpt;
}
$blocked = false;
wfDebug( __METHOD__ . ": self-talk page, ignoring any blocks\n" );
}
-
+
wfRunHooks( 'UserIsBlockedFrom', array( $this, $title, &$blocked, &$allowUsertalk ) );
-
+
wfProfileOut( __METHOD__ );
return $blocked;
}
'user_id' => $this->mId
), __METHOD__
);
-
+
$this->saveOptions();
-
+
wfRunHooks( 'UserSaveSettings', array( $this ) );
$this->clearSharedCache();
$this->getUserPage()->invalidateCache();
// Clear instance cache other than user table data, which is already accurate
$this->clearInstanceCache();
-
+
$this->saveOptions();
}
* @param $byEmail Boolean: account made by email?
*/
public function addNewUserLogEntry( $byEmail = false ) {
- global $wgUser, $wgContLang, $wgNewUserLog;
+ global $wgUser, $wgNewUserLog;
if( empty( $wgNewUserLog ) ) {
return true; // disabled
}
- $talk = $wgContLang->getFormattedNsText( NS_TALK );
+
if( $this->getName() == $wgUser->getName() ) {
$action = 'create';
$message = '';
$this->loadOptions();
$dbw = wfGetDB( DB_MASTER );
-
+
$insert_rows = array();
-
+
$saveOptions = $this->mOptions;
-
+
// Allow hooks to abort, for instance to save to a global profile.
// Reset options to default state before saving.
if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) )
* not create a second WebRequest object; make a FauxRequest object if
* you want to pass arbitrary data to some function in place of the web
* input.
- *
+ *
* @ingroup HTTP
*/
class WebRequest {
*/
public function interpolateTitle() {
global $wgUsePathInfo;
+
if ( $wgUsePathInfo ) {
// PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892
// And also by Apache 2.x, double slashes are converted to single slashes.
// So we will use REQUEST_URI if possible.
$matches = array();
+
if ( !empty( $_SERVER['REQUEST_URI'] ) ) {
// Slurp out the path portion to examine...
$url = $_SERVER['REQUEST_URI'];
*/
private function checkMagicQuotes() {
$mustFixQuotes = function_exists( 'get_magic_quotes_gpc' )
- && get_magic_quotes_gpc();
+ && get_magic_quotes_gpc();
if( $mustFixQuotes ) {
$this->fix_magic_quotes( $_COOKIE );
$this->fix_magic_quotes( $_ENV );
return (string)$val;
}
}
-
+
/**
* Set an aribtrary value into our get/post data.
* @param $key string Key name to use
}
}
}
-
+
/*
* Get data from $_SESSION
* @param $key String Name of key in $_SESSION
return null;
return $_SESSION[$key];
}
-
+
/**
* Set session data
* @param $key String Name of key in $_SESSION
}
/**
- * Returns true if the PATH_INFO ends with an extension other than a script
+ * Returns true if the PATH_INFO ends with an extension other than a script
* extension. This could confuse IE for scripts that send arbitrary data which
* is not HTML but may be detected as such.
*
- * Various past attempts to use the URL to make this check have generally
- * run up against the fact that CGI does not provide a standard method to
- * determine the URL. PATH_INFO may be mangled (e.g. if cgi.fix_pathinfo=0),
- * but only by prefixing it with the script name and maybe some other stuff,
- * the extension is not mangled. So this should be a reasonably portable
+ * Various past attempts to use the URL to make this check have generally
+ * run up against the fact that CGI does not provide a standard method to
+ * determine the URL. PATH_INFO may be mangled (e.g. if cgi.fix_pathinfo=0),
+ * but only by prefixing it with the script name and maybe some other stuff,
+ * the extension is not mangled. So this should be a reasonably portable
* way to perform this security check.
*/
public function isPathInfoBad() {
global $wgScriptExtension;
-
+
if ( !isset( $_SERVER['PATH_INFO'] ) ) {
return false;
}
/**
* Shut down, close connections and destroy the cached instance.
- *
+ *
*/
static function destroyInstance() {
if ( self::$instance ) {
abstract function __construct( $conf );
/**
- * Create a new load balancer object. The resulting object will be untracked,
+ * Create a new load balancer object. The resulting object will be untracked,
* not chronology-protected, and the caller is responsible for cleaning it up.
*
* @param string $wiki Wiki ID, or false for the current wiki
abstract function getMainLB( $wiki = false );
/*
- * Create a new load balancer for external storage. The resulting object will be
- * untracked, not chronology-protected, and the caller is responsible for
+ * Create a new load balancer for external storage. The resulting object will be
+ * untracked, not chronology-protected, and the caller is responsible for
* cleaning it up.
*
* @param string $cluster External storage cluster, or false for core
}
return new LoadBalancer( array(
- 'servers' => $servers,
- 'masterWaitTimeout' => $wgMasterWaitTimeout
+ 'servers' => $servers,
+ 'masterWaitTimeout' => $wgMasterWaitTimeout
));
}
throw new MWException( __METHOD__.": Unknown cluster \"$cluster\"" );
}
return new LoadBalancer( array(
- 'servers' => $wgExternalServers[$cluster]
+ 'servers' => $wgExternalServers[$cluster]
));
}
$this->maybeHelp();
$this->validateParamsAndArgs();
}
-
+
/**
* Normally we disable the memory_limit when running admin scripts.
* Some scripts may wish to actually set a limit, however, to avoid
"to continue installation. ABORTING.\n";
die( -1 );
}
-
+
// Test for PHP bug which breaks PHP 5.0.x on 64-bit...
// As of 1.8 this breaks lots of common operations instead
// of just some rare ones like export.
"or higher. ABORTING. (http://bugs.php.net/bug.php?id=34879 for details)\n";
die( -1 );
}
-
+
$test = new PhpXmlBugTester();
if( !$test->ok ) {
echo "Your system has a combination of PHP and libxml2 versions which is buggy\n" .
"ABORTING (http://bugs.php.net/bug.php?id=45996 for details).\n";
die( -1 );
}
-
+
global $wgCommandLineMode;
$wgCommandLineMode = true;
public function __construct() {
$charData = '<b>c</b>';
$xml = '<a>' . htmlspecialchars( $charData ) . '</a>';
-
+
$parser = xml_parser_create();
xml_set_character_data_handler( $parser, array( $this, 'chardata' ) );
$parsedOk = xml_parse($parser, $xml, true);
$command = "read -er -p $encPrompt && echo \"\$REPLY\"";
$encCommand = wfEscapeShellArg( $command );
$line = wfShellExec( "$bash -c $encCommand", $retval );
-
+
if( $retval == 0 ) {
return $line;
} elseif( $retval == 127 ) {
return false;
}
}
-
+
// Fallback... we'll have no editing controls, EWWW
if ( feof( STDIN ) ) {
return false;