# If the port is a non-standard one, add it to the URL
if( isset( $_SERVER['SERVER_PORT'] )
&& !strpos( $serverName, ':' )
- && ( ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
+ && ( ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
|| ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
$wgServer .= ":" . $_SERVER['SERVER_PORT'];
* This is the list of preferred extensions for uploading files. Uploading files
* with extensions not in this list will trigger a warning.
*
- * WARNING: If you add any OpenOffice or Microsoft Office file formats here,
- * such as odt or doc, and untrusted users are allowed to upload files, then
- * your wiki will be vulnerable to cross-site request forgery (CSRF).
+ * WARNING: If you add any OpenOffice or Microsoft Office file formats here,
+ * such as odt or doc, and untrusted users are allowed to upload files, then
+ * your wiki will be vulnerable to cross-site request forgery (CSRF).
*/
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
'application/x-opc+zip',
);
-/**
+/**
* This is a flag to determine whether or not to check file extensions on upload.
*
* WARNING: setting this to false is insecure for public wikis.
* If this is turned off, users may override the warning for files not covered
* by $wgFileExtensions.
*
- * WARNING: setting this to false is insecure for public wikis.
+ * WARNING: setting this to false is insecure for public wikis.
*/
$wgStrictFileExtensions = true;
*/
/**
- * Client-side resource modules. Extensions should add their module definitions
+ * Client-side resource modules. Extensions should add their module definitions
* here.
*
* Example:
);
/**
- * Whether to embed private modules inline with HTML output or to bypass
- * caching and check the user parameter against $wgUser to prevent
+ * Whether to embed private modules inline with HTML output or to bypass
+ * caching and check the user parameter against $wgUser to prevent
* unauthorized access to private modules.
*/
$wgResourceLoaderInlinePrivateModules = true;
*/
function wfEscapeWikiText( $text ) {
$text = str_replace(
- array( '[', '|', ']', '\'', 'ISBN ',
+ array( '[', '|', ']', '\'', 'ISBN ',
'RFC ', '://', "\n=", '{{', '}}' ),
- array( '[', '|', ']', ''', 'ISBN ',
+ array( '[', '|', ']', ''', 'ISBN ',
'RFC ', '://', "\n=", '{{', '}}' ),
htmlspecialchars( $text )
);
$uts = 0;
$da = array();
$strtime = '';
-
+
if ( $ts === 0 ) {
$uts = time();
$strtime = "@$uts";
return false;
}
-
+
static $formats = array(
TS_UNIX => 'U',
$ds = sprintf("%04d-%02d-%02dT%02d:%02d:%02d.00+00:00",
(int)$da[1], (int)$da[2], (int)$da[3],
(int)$da[4], (int)$da[5], (int)$da[6]);
-
+
$d = date_create( $ds, new DateTimeZone( 'GMT' ) );
} elseif ( $strtime ) {
$d = date_create( $strtime, new DateTimeZone( 'GMT' ) );
} elseif ( $strtime ) {
$uts = strtotime( $strtime );
}
-
+
if ( $uts === false ) {
wfDebug("wfTimestamp() can't parse the timestamp (non 32-bit time? Update php): $outputtype; $ts\n");
return false;
}
-
+
if ( TS_UNIX == $outputtype ) {
return $uts;
}
* @param $cmd String Command line, properly escaped for shell.
* @param &$retval optional, will receive the program's exit code.
* (non-zero is usually failure)
- * @param $environ Array optional environment variables which should be
+ * @param $environ Array optional environment variables which should be
* added to the executed command environment.
* @return collected stdout as a string (trailing newlines stripped)
*/
$envcmd = '';
foreach( $environ as $k => $v ) {
if ( wfIsWindows() ) {
- /* Surrounding a set in quotes (method used by wfEscapeShellArg) makes the quotes themselves
- * appear in the environment variable, so we must use carat escaping as documented in
- * http://technet.microsoft.com/en-us/library/cc723564.aspx
- * Note however that the quote isn't listed there, but is needed, and the parentheses
+ /* Surrounding a set in quotes (method used by wfEscapeShellArg) makes the quotes themselves
+ * appear in the environment variable, so we must use carat escaping as documented in
+ * http://technet.microsoft.com/en-us/library/cc723564.aspx
+ * Note however that the quote isn't listed there, but is needed, and the parentheses
* are listed there but doesn't appear to need it.
*/
$envcmd .= "set $k=" . preg_replace( '/([&|()<>^"])/', '^\\1', $v ) . ' && ';
} else {
- /* Assume this is a POSIX shell, thus required to accept variable assignments before the command
+ /* Assume this is a POSIX shell, thus required to accept variable assignments before the command
* http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01
*/
$envcmd .= "$k=" . escapeshellarg( $v ) . ' ';
}
}
$cmd = $envcmd . $cmd;
-
+
if ( wfIsWindows() ) {
if ( version_compare( PHP_VERSION, '5.3.0', '<' ) && /* Fixed in 5.3.0 :) */
( version_compare( PHP_VERSION, '5.2.1', '>=' ) || php_uname( 's' ) == 'Windows NT' ) )
/**
* Returns the PackageRepository object for interaction with the package repository.
- *
- * TODO: Make the repository type also configurable.
- *
+ *
+ * TODO: Make the repository type also configurable.
+ *
* @since 1.17
- *
+ *
* @return PackageRepository
*/
function wfGetRepository() {
global $wgRepositoryApiLocation;
static $repository = false;
-
+
if ( $repository === false ) {
$repository = new DistributionRepository( $wgRepositoryApiLocation );
}
-
+
return $repository;
}
// IPv6 loopback address
$m = array();
if ( preg_match( '/^0*' . RE_IPV6_GAP . '1$/', $addr, $m ) ) {
- return '127.0.0.1';
+ return '127.0.0.1';
}
// IPv4-mapped and IPv4-compatible IPv6 addresses
if ( preg_match( '/^' . RE_IPV6_V4_PREFIX . '(' . RE_IP_ADD . ')$/i', $addr, $m ) ) {
*/
public function __construct( $params ) {
parent::__construct( $params );
-
+
$this->msg = empty( $params['licenses'] ) ? wfMsgForContent( 'licenses' ) : $params['licenses'];
$this->selected = null;
protected function outputOption( $text, $value, $attribs = null, $depth = 0 ) {
$attribs['value'] = $value;
if ( $value === $this->selected )
- $attribs['selected'] = 'selected';
+ $attribs['selected'] = 'selected';
$val = str_repeat( /*   */ "\xc2\xa0", $depth * 2 ) . $text;
return str_repeat( "\t", $depth ) . Xml::element( 'option', $attribs, $val ) . "\n";
}
*/
public function getInputHTML( $value ) {
$this->selected = $value;
-
+
$this->html = $this->outputOption( wfMsg( 'nolicense' ), '',
(bool)$this->selected ? null : array( 'selected' => 'selected' ) );
$this->makeHtml( $this->getLicenses() );
-
+
$attribs = array(
'name' => $this->mName,
'id' => $this->mID
);
if ( !empty( $this->mParams['disabled'] ) )
$attibs['disabled'] = 'disabled';
-
+
return Html::rawElement( 'select', $attribs, $this->html );
}
}
* either by batch processes or by user accounts which have
* already been created.
*
- * Additional blacklisting may be added here rather than in
+ * Additional blacklisting may be added here rather than in
* isValidUserName() to avoid disrupting existing accounts.
*
* @param $name \string String to match
return 'passwordtooshort';
} elseif ( $lcPassword == $wgContLang->lc( $this->mName ) ) {
return 'password-name-match';
- } elseif ( in_array( $lcPassword, $wgWeakPasswords ) ) {
+ } elseif ( in_array( $lcPassword, $wgWeakPasswords ) ) {
return 'password-too-weak';
} else {
//it seems weird returning true here, but this is because of the
[$rfc1034_ldh_str]+ # First domain part
(\\.[$rfc1034_ldh_str]+)+ # Following part prefixed with a dot
$ # End of string
- /ix" ; // case Insensitive, eXtended
+ /ix" ; // case Insensitive, eXtended
return (bool) preg_match( $HTML5_email_regexp, $addr );
}
}
if( !$this->isValidPassword( $str ) ) {
- global $wgMinimalPasswordLength;
+ global $wgMinimalPasswordLength;
$valid = $this->getPasswordValidity( $str );
throw new PasswordError( wfMsgExt( $valid, array( 'parsemag' ),
$wgMinimalPasswordLength ) );
- }
+ }
}
if( !$wgAuth->setPassword( $this, $str ) ) {
global $wgMaxArticleSize; # Maximum article size, in Kb
$threshold = intval( $this->getOption( 'stubthreshold' ) );
if ( $threshold > $wgMaxArticleSize * 1024 ) {
- # If they have set an impossible value, disable the preference
+ # If they have set an impossible value, disable the preference
# so we can use the parser cache again.
$threshold = 0;
}
return $this->mSkin;
}
}
-
+
// Creates a Skin object, for getSkin()
private function createSkinObject() {
wfProfileIn( __METHOD__ );
$skin = Skin::newFromKey( $userSkin );
wfProfileOut( __METHOD__ );
-
+
return $skin;
}
// If an option is not set in $str, use the default value
$this->mOptions = self::getDefaultOptions();
-
+
$a = explode( "\n", $str );
foreach ( $a as $s ) {
$m = array();
'user_newpassword' => $this->mNewpassword,
'user_newpass_time' => $dbw->timestampOrNull( $this->mNewpassTime ),
'user_real_name' => $this->mRealName,
- 'user_email' => $this->mEmail,
- 'user_email_authenticated' => $dbw->timestampOrNull( $this->mEmailAuthenticated ),
+ 'user_email' => $this->mEmail,
+ 'user_email_authenticated' => $dbw->timestampOrNull( $this->mEmailAuthenticated ),
'user_options' => '',
'user_touched' => $dbw->timestamp( $this->mTouched ),
'user_token' => $this->mToken,
wfDeprecated( __METHOD__ );
// stubthreshold is only included below for completeness,
- // since it disables the parser cache, its value will always
+ // since it disables the parser cache, its value will always
// be 0 when this function is called by parsercache.
$confstr = $this->getOption( 'math' );
*/
function performRequestForTitle( &$title, &$article, &$output, &$user, $request ) {
wfProfileIn( __METHOD__ );
-
+
$output->setTitle( $title );
-
+
wfRunHooks( 'BeforeInitialize', array( &$title, &$article, &$output, &$user, $request, $this ) );
-
+
if( !$this->preliminaryChecks( $title, $output, $request ) ) {
wfProfileOut( __METHOD__ );
return;
{
// Give extensions a change to ignore/handle redirects as needed
$ignoreRedirect = $target = false;
-
+
$dbr = wfGetDB( DB_SLAVE );
$article->loadPageData( $article->pageDataFromTitle( $dbr, $title ) );
- wfRunHooks( 'InitializeArticleMaybeRedirect',
+ wfRunHooks( 'InitializeArticleMaybeRedirect',
array(&$title,&$request,&$ignoreRedirect,&$target,&$article) );
// Follow redirects only for... redirects.
/**
* Get an array of install steps. These could be a plain key like the defaults
* in $installSteps, or could be an array with a name and a specific callback
- * There must be a config-install-$step message defined per step, which will
+ * There must be a config-install-$step message defined per step, which will
* be shown on install.
*
* @param $installer DatabaseInstaller so we can make callbacks
array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ),
);
if( count( $this->getVar( '_Extensions' ) ) ) {
- array_unshift( $installSteps,
+ array_unshift( $installSteps,
array( 'name' => 'extensions', 'callback' => array( $this, 'includeExtensions' ) )
);
}
protected function generateSecretKey() {
return $this->generateSecret( 'wgSecretKey' );
}
-
+
/**
- * Generate a secret value for a variable using either
+ * Generate a secret value for a variable using either
* /dev/urandom or mt_rand() Produce a warning in the later case.
*
* @return Status
}
/**
- * Generate a default $wgUpradeKey, Will warn if we had to use
+ * Generate a default $wgUpradeKey, Will warn if we had to use
* mt_rand() instead of /dev/urandom
*
* @return Status
/**
* Insert Main Page with default content.
- *
+ *
* @return Status
*/
protected function createMainpage( DatabaseInstaller &$installer ) {
User::newFromName( 'MediaWiki Default' ) );
} catch (MWException $e) {
//using raw, because $wgShowExceptionDetails can not be set yet
- $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
+ $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
}
-
+
return $status;
}
* @file
* @ingroup Deployment
*/
-
+
/**
* Class for setting up the MediaWiki database using Postgres.
*
}
$nav[$section][$key]['attributes'] =
' id="' . Sanitizer::escapeId( $xmlID ) . '"';
- if ( $nav[$section][$key]['class'] ) {
+ if ( $nav[$section][$key]['class'] ) {
$nav[$section][$key]['attributes'] .=
' class="' . htmlspecialchars( $link['class'] ) . '"';
unset( $nav[$section][$key]['class'] );
- }
+ }
// We don't want to give the watch tab an accesskey if the page
// is being edited, because that conflicts with the accesskey on
// the watch checkbox. We also don't want to give the edit tab
// an accesskey, because that's fairly superfluous and conflicts
// with an accesskey (Ctrl-E) often used for editing in Safari.
- if (
+ if (
in_array( $action, array( 'edit', 'submit' ) ) &&
in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
) {
- $nav[$section][$key]['key'] =
+ $nav[$section][$key]['key'] =
$this->skin->tooltip( $xmlID );
- } else {
- $nav[$section][$key]['key'] =
+ } else {
+ $nav[$section][$key]['key'] =
$this->skin->tooltipAndAccesskey( $xmlID );
- }
+ }
}
}
$this->data['namespace_urls'] = $nav['namespaces'];
$footerlinksClasses = array(
'icons' => array( 'noprint' )
);
-
+
// Reduce footer links down to only those which are being used
$validFooterLinks = array();
foreach( $footerlinks as $category => $links ) {