*
* Actions generally fall into two groups: the show-a-form-then-do-something-with-the-input
* format (protect, delete, move, etc), and the just-do-something format (watch, rollback,
- * patrol, etc). The FormAction and FormlessAction classes respresent these two groups.
+ * patrol, etc). The FormAction and FormlessAction classes represent these two groups.
*/
abstract class Action {
# tell the client to use a cached copy, without a way to purge it.
if ( $wgUseSquid ) {
- # Expect explicite purge of the proxy cache, but require end user agents
+ # Expect explicit purge of the proxy cache, but require end user agents
# to revalidate against the proxy on each visit.
# Surrogate-Control controls our Squid, Cache-Control downstream caches
*
* @param $oldid mixed integer Revision ID or null
* @param $user User The relevant user
- * @return ParserOutput or false if the given revsion ID is not found
+ * @return ParserOutput or false if the given revision ID is not found
*/
public function getParserOutput( $oldid = null, User $user = null ) {
//XXX: bypasses mParserOptions and thus setParserOptions()
return true;
}
}
- # If we got here, the array presumably does not contain other condi-
- # tions; it's not recursive. Pass it off to self::checkCondition.
+ // If we got here, the array presumably does not contain other conditions;
+ // it's not recursive. Pass it off to self::checkCondition.
if ( !is_array( $cond ) ) {
$cond = array( $cond );
}
/**
* As recCheckCondition, but *not* recursive. The only valid conditions
* are those whose first element is APCOND_EMAILCONFIRMED/APCOND_EDITCOUNT/
- * APCOND_AGE. Other types will throw an exception if no extension evalu-
- * ates them.
+ * APCOND_AGE. Other types will throw an exception if no extension evaluates them.
*
* @param array $cond A condition, which must not contain other conditions
* @param $user User The user to check the condition against
/**
* Load a block from the database which affects the already-set $this->target:
* 1) A block directly on the given user or IP
- * 2) A rangeblock encompasing the given IP (smallest first)
+ * 2) A rangeblock encompassing the given IP (smallest first)
* 3) An autoblock on the given IP
* @param $vagueTarget User|String also search for blocks affecting this target. Doesn't
* make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups.
list( $target, $type ) = self::parseTarget( $vagueTarget );
switch( $type ) {
case self::TYPE_USER:
- # Slightly wierd, but who are we to argue?
+ # Slightly weird, but who are we to argue?
$conds['ipb_address'][] = (string)$target;
break;
}
/**
- * Get a set of SQL conditions which will select rangeblocks encompasing a given range
+ * Get a set of SQL conditions which will select rangeblocks encompassing a given range
* @param string $start Hexadecimal IP representation
- * @param string $end Hexadecimal IP represenation, or null to use $start = $end
+ * @param string $end Hexadecimal IP representation, or null to use $start = $end
* @return String
*/
public static function getRangeCond( $start, $end = null ) {
* Update a block in the DB with new parameters.
* The ID field needs to be loaded first.
*
- * @return Int number of affected rows, which should probably be 1 or something's
+ * @return Int number of affected rows, which should probably be 1 or something has
* gone slightly awry
*/
public function update() {
}
/**
- * Gets rid of uneeded numbers in quad-dotted/octet IP strings
+ * Gets rid of unneeded numbers in quad-dotted/octet IP strings
* For example, 127.111.113.151/24 -> 127.111.113.0/24
* @param string $range IP address to normalize
* @return string
/**
* Set the user who implemented (or will implement) this block
- * @param $user User|string Local User object or username string for foriegn users
+ * @param $user User|string Local User object or username string for foreign users
*/
public function setBlocker( $user ) {
$this->blocker = $user;
# NOTE: the row often results from a LEFT JOIN on categorylinks. This may result in
# all the cat_xxx fields being null, if the category page exists, but nothing
- # was ever added to the category. This case should be treated linke an empty
+ # was ever added to the category. This case should be treated link an empty
# category, if possible.
if ( $row->cat_title === null ) {
$link = Linker::link( $title );
if ( $isRedirect ) {
// This seems kind of pointless given 'mw-redirect' class,
- // but keeping for back-compatiability with user css.
+ // but keeping for back-compatibility with user css.
$link = '<span class="redirect-in-category">' . $link . '</span>';
}
$this->articles[] = $link;
$r = '';
# @todo FIXME: Here and in the other two sections: we don't need to bother
- # with this rigamarole if the entire category contents fit on one page
+ # with this rigmarole if the entire category contents fit on one page
# and have already been retrieved. We can just use $rescnt in that
# case and save a query and some logic.
$dbcnt = $this->cat->getPageCount() - $this->cat->getSubcatCount()
* Create paging links, as a helper method to getSectionPagingLinks().
*
* @param string $first The 'until' parameter for the generated URL
- * @param string $last The 'from' parameter for the genererated URL
+ * @param string $last The 'from' parameter for the generated URL
* @param string $type A prefix for parameters, 'page' or 'subcat' or
* 'file'
* @return String HTML
$path[] = $id;
- # Shortcut (runtime paranoia): No contitions=all matched
+ # Shortcut (runtime paranoia): No conditions=all matched
if ( count( $conds ) == 0 ) {
return true;
}
* @param $rc_id int: rc_id of the change to add the tags to
* @param $rev_id int: rev_id of the change to add the tags to
* @param $log_id int: log_id of the change to add the tags to
- * @param string $params params to put in the ct_params field of tabel 'change_tag'
+ * @param string $params params to put in the ct_params field of table 'change_tag'
*
* @throws MWException
* @return bool: false if no changes are made, otherwise true
* Handles selecting tags, and filtering.
* Needs $tables to be set up properly, so we can figure out which join conditions to use.
*
- * @param string|array $tables Tabel names, see DatabaseBase::select
+ * @param string|array $tables Table names, see DatabaseBase::select
* @param string|array $fields Fields used in query, see DatabaseBase::select
* @param string|array $conds conditions used in query, see DatabaseBase::select
* @param $join_conds Array: join conditions, see DatabaseBase::select
protected $message;
/**
- * Changeslist contructor
+ * Changeslist constructor
*
* @param $obj Skin or IContextSource
*/
}
public function insertExtra( &$s, &$rc, &$classes ) {
- ## Empty, used for subclassers to add anything special.
+ // Empty, used for subclasses to add anything special.
}
protected function showAsUnpatrolled( RecentChange $rc ) {
// Include some information about the filesystem's current state in the random state
$files = array();
- // We know this file is here so grab some info about ourself
+ // We know this file is here so grab some info about ourselves
$files[] = __FILE__;
// We must also have a parent folder, and with the usual file structure, a grandparent
$buffer = str_repeat( ' ', $bufLength );
$bufPos = 0;
- // Iterate for $duration seconds or at least $minIerations number of iterations
+ // Iterate for $duration seconds or at least $minIterations number of iterations
$iterations = 0;
$startTime = microtime( true );
$currentTime = $startTime;
*
* This methods supports transactions logic by first calling beginTransaction()
* on all updates in the array, then calling doUpdate() on each, and, if all goes well,
- * then calling commitTransaction() on each update. If an error occurrs,
- * rollbackTransaction() will be called on any update object that had beginTranscation()
+ * then calling commitTransaction() on each update. If an error occurs,
+ * rollbackTransaction() will be called on any update object that had beginTransaction()
* called but not yet commitTransaction().
*
* This allows for limited transactional logic across multiple backends for storing
/** @} */ # end of Interwiki caching settings.
/**
- * If local interwikies are set up which allow redirects,
+ * If local interwikis are set up which allow redirects,
* set this regexp to restrict URLs which will be displayed
* as 'redirected from' links.
*
}
/**
- * Class for mananging the deferred updates.
+ * Class for managing the deferred updates.
*
* @since 1.19
*/
*/
define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found
define( 'AV_VIRUS_FOUND', 1 ); #virus found!
-define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably imune
+define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably immune
define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner)
/**@}*/
const AS_HOOK_ERROR_EXPECTED = 212;
/**
- * Status: User is blocked from editting this page
+ * Status: User is blocked from editing this page
*/
const AS_BLOCKED_PAGE_FOR_USER = 215;
const AS_RATE_LIMITED = 221;
/**
- * Status: article was deleted while editting and param wpRecreate == false or form
+ * Status: article was deleted while editing and param wpRecreate == false or form
* was not posted
*/
const AS_ARTICLE_WAS_DELETED = 222;
/**
* Status: no edit summary given and the user has forceeditsummary set and the user is not
- * editting in his own userspace or talkspace and wpIgnoreBlankSummary == false
+ * editing in his own userspace or talkspace and wpIgnoreBlankSummary == false
*/
const AS_SUMMARY_NEEDED = 226;
const AS_OK = 230;
/**
- * Status: WikiPage::doEdit() was unsuccessfull
+ * Status: WikiPage::doEdit() was unsuccessful
*/
const AS_END = 231;
public $previewTextAfterContent = '';
public $mPreloadContent = null;
- /* $didSave should be set to true whenever an article was succesfully altered. */
+ /* $didSave should be set to true whenever an article was successfully altered. */
public $didSave = false;
public $undidRev = 0;
$this->save = false;
$this->diff = false;
$this->minoredit = false;
- $this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overriden by request parameters
+ $this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overridden by request parameters
$this->recreate = false;
// When creating a new section, we can preload a section title by passing it as the
/**
* Subpage overridable method for extracting the page content data from the
* posted form to be placed in $this->textbox1, if using customized input
- * this method should be overrided and return the page text that will be used
+ * this method should be overridden and return the page text that will be used
* for saving, preview parsing and so on...
*
* @param $request WebRequest
* section replaced in its context (using WikiPage::replaceSection())
* to the original text of the edit.
*
- * This difers from Article::getContent() that when a missing revision is
+ * This differs from Article::getContent() that when a missing revision is
* encountered the result will be null and not the
* 'missing-revision' message.
*
}
if ( $this->hasPresetSummary ) {
- // If a summary has been preset using &summary= we dont want to prompt for
+ // If a summary has been preset using &summary= we don't want to prompt for
// a different summary. Only prompt for a summary if the summary is blanked.
// (Bug 17416)
$this->autoSumm = md5( '' );
}
if ( $this->isConflict ) {
- // In an edit conflict bypass the overrideable content form method
+ // In an edit conflict bypass the overridable content form method
// and fallback to the raw wpTextbox1 since editconflicts can't be
// resolved between page source edits and custom ui edits using the
// custom edit ui.
* @return array An array in the format array( $label, $input )
*/
function getSummaryInput( $summary = "", $labelText = null, $inputAttrs = null, $spanLabelAttrs = null ) {
- // Note: the maxlength is overriden in JS to 255 and to make it use UTF-8 bytes, not characters.
+ // Note: the maxlength is overridden in JS to 255 and to make it use UTF-8 bytes, not characters.
$inputAttrs = ( is_array( $inputAttrs ) ? $inputAttrs : array() ) + array(
'id' => 'wpSummary',
'maxlength' => '200',
* @private
*/
function makesafe( $invalue ) {
- // Armor existing references for reversability.
+ // Armor existing references for reversibility.
$invalue = strtr( $invalue, array( "&#x" => "�" ) );
$bytesleft = 0;
$i++;
} while ( ctype_xdigit( $invalue[$i] ) && ( $i < strlen( $invalue ) ) );
- // Do some sanity checks. These aren't needed for reversability,
+ // Do some sanity checks. These aren't needed for reversibility,
// but should help keep the breakage down if the editor
// breaks one of the entities whilst editing.
if ( ( substr( $invalue, $i, 1 ) == ";" ) and ( strlen( $hexstring ) <= 6 ) ) {
$result .= substr( $invalue, $i, 1 );
}
}
- // reverse the transform that we made for reversability reasons.
+ // reverse the transform that we made for reversibility reasons.
return strtr( $result, array( "�" => "&#x" ) );
}
}
/**
* Get a random ID for this error.
- * This allows to link the exception to its correspoding log entry when
+ * This allows to link the exception to its corresponding log entry when
* $wgShowExceptionDetails is set to false.
*
* @return string
$join['revision'] = array( 'INNER JOIN', 'page_id=rev_page' );
$opts['ORDER BY'] = array( 'rev_page ASC', 'rev_id ASC' );
} else {
- # Uknown history specification parameter?
+ # Unknown history specification parameter?
wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . " given invalid history dump type." );
}
}
/**
- * Base class for output stream; prints to stdout or buffer or whereever.
+ * Base class for output stream; prints to stdout or buffer or wherever.
* @ingroup Dump
*/
class DumpOutput {
}
/**
- * Base class for output stream; prints to stdout or buffer or whereever.
+ * Base class for output stream; prints to stdout or buffer or wherever.
* @ingroup Dump
*/
class DumpMultiWriter {
}
/**
- * Ouput an RSS 2.0 header
+ * Output an RSS 2.0 header
*/
function outHeader() {
global $wgVersion;
}
/**
- * Ouput an RSS 2.0 footer
+ * Output an RSS 2.0 footer
*/
function outFooter() {
?>
}
/**
- * Atom 1.0 requires a unique, opaque IRI as a unique indentifier
+ * Atom 1.0 requires a unique, opaque IRI as a unique identifier
* for every feed we create. For now just use the URL, but who
* can tell if that's right? If we put options on the feed, do we
* have to change the id? Maybe? Maybe not.
}
/**
- * Outputs the footer for Atom 1.0 feed (basicly '\</feed\>').
+ * Outputs the footer for Atom 1.0 feed (basically '\</feed\>').
*/
function outFooter() {?>
</feed><?php
global $wgFeedDiffCutoff, $wgLang;
wfProfileIn( __METHOD__ );
- # log enties
+ // log entries
$completeText = '<p>' . implode( ' ',
array_filter(
array(
// NOTE: Check permissions for anonymous users, not current user.
// No "privileged" version should end up in the cache.
- // Most feed readers will not log in anway.
+ // Most feed readers will not log in anyway.
$anon = new User();
$accErrors = $title->getUserPermissionsErrors( 'read', $anon, true );
}
/**
- * Get a random string containing a number of pesudo-random hex
+ * Get a random string containing a number of pseudo-random hex
* characters.
* @note This is not secure, if you are trying to generate some sort
* of token please use MWCryptRand instead.
/**
* This is the logical opposite of wfArrayToCgi(): it accepts a query string as
- * its argument and returns the same string in array form. This allows compa-
- * tibility with legacy functions that accept raw query strings instead of nice
+ * its argument and returns the same string in array form. This allows compatibility
+ * with legacy functions that accept raw query strings instead of nice
* arrays. Of course, keys and values are urldecode()d.
*
* @param string $query query string
* @param $function String
* @param string|bool $version Version of MediaWiki that the function was deprecated in (Added in 1.19).
* @param string|bool $component Added in 1.19.
- * @param $callerOffset integer: How far up the callstack is the original
+ * @param $callerOffset integer: How far up the call stack is the original
* caller. 2 = function that called the function that called
* wfDeprecated (Added in 1.20)
*
* <i>content</i>: fetch message for content language instead of interface
* Also can accept a single associative argument, of the form 'language' => 'xx':
* <i>language</i>: Language object or language code to fetch message for
- * (overriden by <i>content</i>).
+ * (overridden by <i>content</i>).
* Behavior for conflicting options (e.g., parse+parseinline) is undefined.
*
* @return String
/**
* Since wfMsg() and co suck, they don't return false if the message key they
* looked up didn't exist but a XHTML string, this function checks for the
- * nonexistance of messages by checking the MessageCache::get() result directly.
+ * nonexistence of messages by checking the MessageCache::get() result directly.
*
* @deprecated since 1.18. Use Message::isDisabled().
*
*
* With Zend Optimizer 3.2.0 loaded, this causes segfaults under somewhat
* murky circumstances, which may be triggered in part by stub objects
- * or other fancy talkin'.
+ * or other fancy talking'.
*
* Will return an empty array if Zend Optimizer is detected or if
* debug_backtrace is disabled, otherwise the output from
}
/**
- * Get the current unix timetstamp with microseconds. Useful for profiling
+ * Get the current unix timestamp with microseconds. Useful for profiling
* @return Float
*/
function wfTime() {
}
/**
- * Check if there is sufficent entropy in php's built-in session generation
+ * Check if there is sufficient entropy in php's built-in session generation
* @return bool true = there is sufficient entropy
*/
function wfCheckEntropy() {
* characters before hashing.
* @return string
* @codeCoverageIgnore
- * @deprecated since 1.20; Please use MWCryptRand for security purposes and wfRandomString for pesudo-random strings
- * @warning This method is NOT secure. Additionally it has many callers that use it for pesudo-random purposes.
+ * @deprecated since 1.20; Please use MWCryptRand for security purposes and wfRandomString for pseudo-random strings
+ * @warning This method is NOT secure. Additionally it has many callers that use it for pseudo-random purposes.
*/
function wfGenerateToken( $salt = '' ) {
wfDeprecated( __METHOD__, '1.20' );
*
* @param string $format The format string (See php's docs)
* @param $data: A binary string of binary data
- * @param $length integer or false: The minimun length of $data. This is to
+ * @param $length integer or false: The minimum length of $data. This is to
* prevent reading beyond the end of $data. false to disable the check.
*
* Also be careful when using this function to read unsigned 32 bit integer
}
/**
- * Validate all the fields, and call the submision callback
+ * Validate all the fields, and call the submission callback
* function if everything is kosher.
* @throws MWException
* @return Mixed Bool true == Successful submission, Bool false
/**
* Set the prefix for various default messages
* @todo currently only used for the "<fieldset>" legend on forms
- * with multiple sections; should be used elsewhre?
+ * with multiple sections; should be used elsewhere?
* @param $p String
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Get a translated interface message
*
- * This is a wrapper arround $this->mParent->msg() if $this->mParent is set
+ * This is a wrapper around $this->mParent->msg() if $this->mParent is set
* and wfMessage() otherwise.
*
* Parameters are the same as wfMessage().
if ( in_array( $key, $spaceSeparatedListAttributes ) ) {
// Apply some normalization and remove duplicates
- // Convert into correct array. Array can contain space-seperated
+ // Convert into correct array. Array can contain space-separated
// values. Implode/explode to get those into the main array as well.
if ( is_array( $value ) ) {
// If input wasn't an array, we can skip this step
if ( !isset( $value[$v] ) ) {
// As a special case don't set 'foo' if a
// separate 'foo' => true/false exists in the array
- // keys should be authoritive
+ // keys should be authoritative
$newValue[] = $v;
}
} elseif ( $v ) {
// Value is provided by user, the name shown is localized for the user.
$options[$params['all']] = wfMessage( 'namespacesall' )->text();
}
- // Add all namespaces as options (in the content langauge)
+ // Add all namespaces as options (in the content language)
$options += $wgContLang->getFormattedNamespaces();
// Convert $options to HTML and filter out namespaces below 0
}
if ( $nsId === NS_MAIN ) {
// For other namespaces use use the namespace prefix as label, but for
- // main we don't use "" but the user message descripting it (e.g. "(Main)" or "(Article)")
+ // main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)")
$nsName = wfMessage( 'blanknamespace' )->text();
} elseif ( is_int( $nsId ) ) {
$nsName = $wgContLang->convertNamespace( $nsId );
}
/**
- * Set the refererer header
+ * Set the referrer header
*/
public function setReferer( $url ) {
$this->setHeader( 'Referer', $url );
/**
* Parses the headers, including the HTTP status code and any
- * Set-Cookie headers. This function expectes the headers to be
+ * Set-Cookie headers. This function expects the headers to be
* found in an array in the member variable headerList.
*/
protected function parseHeader() {
$ip
);
}
- // Remove leading zereos from each bloc as needed
+ // Remove leading zeros from each bloc as needed
$ip = preg_replace( '/(^|:)0+(' . RE_IPV6_WORD . ')/', '$1$2', $ip );
return $ip;
}
}
/**
- * Gets rid of uneeded numbers in quad-dotted/octet IP strings
+ * Gets rid of unneeded numbers in quad-dotted/octet IP strings
* For example, 127.111.113.151/24 -> 127.111.113.0/24
* @param string $range IP address to normalize
* @return string
# http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 -Ævar
# Weird double wrapping (the extra div inside the li) needed due to FF2 bug
- # Can be safely removed if FF2 falls completely out of existance
+ # Can be safely removed if FF2 falls completely out of existence
$output .=
"\n\t\t" . '<li class="gallerybox" style="width: ' . ( $this->mWidths + self::THUMB_PADDING + self::GB_PADDING ) . 'px">'
. '<div style="width: ' . ( $this->mWidths + self::THUMB_PADDING + self::GB_PADDING ) . 'px">'
# @todo FIXME: Why is this using escapeId for a class?!
$class = Sanitizer::escapeId( $v['id'] );
if ( $type == 'collapsed' ) {
- $class .= ' collapsable';
+ $class .= ' collapsable'; // sic
}
$r .= "<tr class=\"$class\">\n";
$r .= "<th>{$v['name']}</th>\n";
if ( $width > $maxWidth || $height > $maxHeight ) {
# Calculate the thumbnail size.
# First case, the limiting factor is the width, not the height.
- if ( $width / $height >= $maxWidth / $maxHeight ) { // FIXME: Possible divison by 0. bug 36911
- $height = round( $height * $maxWidth / $width ); // FIXME: Possible divison by 0. bug 36911
+ if ( $width / $height >= $maxWidth / $maxHeight ) { // FIXME: Possible division by 0. bug 36911
+ $height = round( $height * $maxWidth / $width ); // FIXME: Possible division by 0. bug 36911
$width = $maxWidth;
# Note that $height <= $maxHeight now.
} else {
- $newwidth = floor( $width * $maxHeight / $height ); // FIXME: Possible divison by 0. bug 36911
- $height = round( $height * $newwidth / $width ); // FIXME: Possible divison by 0. bug 36911
+ $newwidth = floor( $width * $maxHeight / $height ); // FIXME: Possible division by 0. bug 36911
+ $height = round( $height * $newwidth / $width ); // FIXME: Possible division by 0. bug 36911
$width = $newwidth;
# Note that $height <= $maxHeight now, but might not be identical
# because of rounding.
$nofile = 'filepage-nofile';
}
// Note, if there is an image description page, but
- // no image, then this setRobotPolicy is overriden
+ // no image, then this setRobotPolicy is overridden
// by Article::View().
$out->setRobotPolicy( 'noindex,nofollow' );
$out->wrapWikiMsg( "<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
}
/**
- * Returns the corrosponding $wgImageLimits entry for the selected user option
+ * Returns the corresponding $wgImageLimits entry for the selected user option
*
* @param $user User
* @param string $optionName Name of a option to check, typically imagesize or thumbsize
}
if ( $status->isGood() ) {
- wfDebug( __METHOD__ . ": Succesful\n" );
+ wfDebug( __METHOD__ . ": Successful\n" );
return true;
} else {
wfDebug( __METHOD__ . ': failed: ' . $status->getXml() . "\n" );
}
/**
- * Determine wether a method exists within a class, using a method which works
+ * Determine whether a method exists within a class, using a method which works
* under HipHop.
*
* Note that under HipHop when method_exists is given a string for it's class
// Reverse the labels in the hostname, convert to lower case
// For emails reverse domainpart only
if ( $prot == 'mailto:' && strpos( $host, '@' ) ) {
- // complete email adress
+ // complete email address
$mailparts = explode( '@', $host );
$domainpart = strtolower( implode( '.', array_reverse( explode( '.', $mailparts[1] ) ) ) );
$host = $domainpart . '@' . $mailparts[0];
$like = array( "$prot$host", $db->anyString() );
} elseif ( $prot == 'mailto:' ) {
- // domainpart of email adress only. do not add '.'
+ // domainpart of email address only. do not add '.'
$host = strtolower( implode( '.', array_reverse( explode( '.', $host ) ) ) );
$like = array( "$prot$host", $db->anyString() );
} else {
const TOOL_LINKS_EMAIL = 2;
/**
- * Get the appropriate HTML attributes to add to the "a" element of an ex-
- * ternal link, as created by [wikisyntax].
+ * Get the appropriate HTML attributes to add to the "a" element of an
+ * external link, as created by [wikisyntax].
*
* @param string $class the contents of the class attribute; if an empty
* string is passed, which is the default value, defaults to 'external'.
}
/**
- * Get the appropriate HTML attributes to add to the "a" element of an in-
- * terwiki link.
+ * Get the appropriate HTML attributes to add to the "a" element of an interwiki link.
*
* @param string $title the title text for the link, URL-encoded (???) but
* not HTML-escaped
}
/**
- * Get the appropriate HTML attributes to add to the "a" element of an in-
- * ternal link.
+ * Get the appropriate HTML attributes to add to the "a" element of an internal link.
*
* @param string $title the title text for the link, URL-encoded (???) but
* not HTML-escaped
}
/**
- * Get the appropriate HTML attributes to add to the "a" element of an in-
- * ternal link, given the Title object for the page we want to link to.
+ * Get the appropriate HTML attributes to add to the "a" element of an internal
+ * link, given the Title object for the page we want to link to.
*
* @param $nt Title
* @param string $unused unused
* the link text. This is raw HTML and will not be escaped. If null,
* defaults to the prefixed text of the Title; or if the Title is just a
* fragment, the contents of the fragment.
- * @param array $customAttribs A key => value array of extra HTML attri-
- * butes, such as title and class. (href is ignored.) Classes will be
+ * @param array $customAttribs A key => value array of extra HTML attributes,
+ * such as title and class. (href is ignored.) Classes will be
* merged with the default classes, while other attributes will replace
* default attributes. All passed attribute values will be HTML-escaped.
* A false attribute value means to suppress that attribute.
* @return string
*/
private static function linkText( $target ) {
- # We might be passed a non-Title by make*LinkObj(). Fail gracefully.
+ // We might be passed a non-Title by make*LinkObj(). Fail gracefully.
if ( !$target instanceof Title ) {
return '';
}
- # If the target is just a fragment, with no title, we return the frag-
- # ment text. Otherwise, we return the title text itself.
+ // If the target is just a fragment, with no title, we return the fragment
+ // text. Otherwise, we return the title text itself.
if ( $target->getPrefixedText() === '' && $target->getFragment() !== '' ) {
return htmlspecialchars( $target->getFragment() );
}
* caption HTML for image caption.
* link-url URL to link to
* link-title Title object to link to
- * link-target Value for the target attribue, only with link-url
+ * link-target Value for the target attribute, only with link-url
* no-link Boolean, suppress description link
*
* @param array $handlerParams associative array of media handler parameters, to be passed
'valign' => isset( $fp['valign'] ) ? $fp['valign'] : false,
'img-class' => $fp['class'] );
if ( isset( $fp['border'] ) ) {
+ // TODO: BUG? Both values are identical
$params['img-class'] .= ( $params['img-class'] !== '' ) ? ' thumbborder' : 'thumbborder';
}
$params = self::getImageLinkMTOParams( $fp, $query, $parser ) + $params;
public static function commentBlock( $comment, $title = null, $local = false ) {
// '*' used to be the comment inserted by the software way back
// in antiquity in case none was provided, here for backwards
- // compatability, acc. to brion -ævar
+ // compatibility, acc. to brion -ævar
if ( $comment == '' || $comment == '*' ) {
return '';
} else {
* is set and the user is the only contributor of the page.
*
* @param $rev Revision object
- * @param bool $verify Try to verfiy that this revision can really be rolled back
+ * @param bool $verify Try to verify that this revision can really be rolled back
* @return integer|bool|null
*/
public static function getRollbackEditCount( $rev, $verify ) {
*/
/**
- * The Message class provides methods which fullfil two basic services:
+ * The Message class provides methods which fulfil two basic services:
* - fetching interface messages
* - processing messages into a variety of formats
*
- * First implemented with MediaWiki 1.17, the Message class is intented to
+ * First implemented with MediaWiki 1.17, the Message class is intended to
* replace the old wfMsg* functions that over time grew unusable.
* @see https://www.mediawiki.org/wiki/Manual:Messages_API for equivalences
* between old and new functions.
/**
* Factory function that is just wrapper for the real constructor. It is
- * intented to be used instead of the real constructor, because it allows
+ * intended to be used instead of the real constructor, because it allows
* chaining method calls, while new objects don't.
* @since 1.17
* @param string $key message key
}
/**
- * Returns the message text as-is, only parameters are subsituted.
+ * Returns the message text as-is, only parameters are substituted.
* @since 1.17
* @return String: Unescaped untransformed message text.
*/
}
/**
- * Substitutes any paramaters into the message text.
+ * Substitutes any parameters into the message text.
* @since 1.17
* @param string $message the message text
* @param string $type either before or after
* A message blob is a JSON object containing the interface messages for a
* certain resource in a certain language. These message blobs are cached
* in the msg_resource table and automatically invalidated when one of their
- * consistuent messages or the resource itself is changed.
+ * constituent messages or the resource itself is changed.
*/
class MessageBlobStore {
*/
var $mMimeTypeAliases = null;
- /** map of mime types to file extensions (as a space seprarated list)
+ /** map of mime types to file extensions (as a space separated list)
*/
var $mMimeToExt = null;
- /** map of file extensions types to mime types (as a space seprarated list)
+ /** map of file extensions types to mime types (as a space separated list)
*/
var $mExtToMime = null;
/**
* Mime type detection. This uses detectMimeType to detect the mime type
* of the file, but applies additional checks to determine some well known
- * file formats that may be missed or misinterpreter by the default mime
+ * file formats that may be missed or misinterpreted by the default mime
* detection (namely XML based formats like XHTML or SVG, as well as ZIP
* based formats like OPC/ODF files).
*
* Internal mime type detection. Detection is done using an external
* program, if $wgMimeDetectorCommand is set. Otherwise, the fileinfo
* extension and mime_content_type are tried (in this order), if they
- * are available. If the dections fails and $ext is not false, the mime
+ * are available. If the detections fails and $ext is not false, the mime
* type is guessed from the file extension, using guessTypesForExtension.
*
* If the mime type is still unknown, getimagesize is used to detect the
# NOTE: this function is available since PHP 4.3.0, but only if
# PHP was compiled with --with-mime-magic or, before 4.3.2, with --enable-mime-magic.
#
- # On Windows, you must set mime_magic.magicfile in php.ini to point to the mime.magic file bundeled with PHP;
+ # On Windows, you must set mime_magic.magicfile in php.ini to point to the mime.magic file bundled with PHP;
# sometimes, this may even be needed under linus/unix.
#
# Also note that this has been DEPRECATED in favor of the fileinfo extension by PECL, see above.
* File extensions are represented by a string starting with a dot (.) to
* distinguish them from mime types.
*
- * This funktion relies on the mapping defined by $this->mMediaTypes
+ * This function relies on the mapping defined by $this->mMediaTypes
* @access private
* @return int|string
*/
* sure that code will not potentially break.
*
* @param int $ns1 The first namespace index
- * @param int $ns2 The second namespae index
+ * @param int $ns2 The second namespace index
*
* @return bool
* @since 1.19
* NS_USER and NS_USER_TALK will return true.
*
* @param int $ns1 The first namespace index
- * @param int $ns2 The second namespae index
+ * @param int $ns2 The second namespace index
*
* @return bool
* @since 1.19
*/
function wfGzipHandler( $s ) {
if( !function_exists( 'gzencode' ) ) {
- wfDebug( __FUNCTION__ . "() skipping compression (gzencode unavaible)\n" );
+ wfDebug( __FUNCTION__ . "() skipping compression (gzencode unavailable)\n" );
return $s;
}
if( headers_sent() ) {
var $mScripts = '';
/**
- * Inline CSS styles. Use addInlineStyle() sparsingly
+ * Inline CSS styles. Use addInlineStyle() sparingly
*/
var $mInlineStyles = '';
}
/**
- * Replace the subtile with $str
+ * Replace the subtitle with $str
*
* @param string|Message $str new value of the subtitle. String should be safe HTML.
*/
}
/**
- * As for setAllowedModules(), but don't inadvertantly make the page more accessible
+ * As for setAllowedModules(), but don't inadvertently make the page more accessible
* @param $type String
* @param $level Int ResourceLoaderModule class constant
*/
* @param $interface Boolean: is this text in the user interface language?
*/
public function addWikiText( $text, $linestart = true, $interface = true ) {
- $title = $this->getTitle(); // Work arround E_STRICT
+ $title = $this->getTitle(); // Work around E_STRICT
if ( !$title ) {
throw new MWException( 'Title is null' );
}
}
/**
- * Get the message associed with the HTTP response code $code
+ * Get the message associated with the HTTP response code $code
*
* @param $code Integer: status code
* @return String or null: message or null if $code is not in the list of
}
/**
- * Turn off regular page output and return an error reponse
+ * Turn off regular page output and return an error response
* for when rate limiting has triggered.
*/
public function rateLimited() {
}
// Special handling for the user group; because users might change their stuff
// on-wiki like user pages, or user preferences; we need to find the highest
- // timestamp of these user-changable modules so we can ensure cache misses on change
+ // timestamp of these user-changeable modules so we can ensure cache misses on change
// This should NOT be done for the site group (bug 27564) because anons get that too
// and we shouldn't be putting timestamps in Squid-cached HTML
$version = null;
// Example supported values for $media: 'screen', 'only screen', 'screen and (min-width: 982px)' ),
// Example NOT supported value for $media: '3d-glasses, screen, print and resolution > 90dpi'
//
- // If it's a print request, we never want any kind of screen styesheets
+ // If it's a print request, we never want any kind of screen stylesheets
// If it's a handheld request (currently the only other choice with a switch),
// we don't want simple 'screen' but we might want screen queries that
// have a max-width or something, so we'll pass all others on and let the
/**
* Display something vaguely comprehensible in the event of a totally unrecoverable error.
- * Does not assume access to *anything*; no globals, no autloader, no database, no localisation.
+ * Does not assume access to *anything*; no globals, no autoloader, no database, no localisation.
* Safe for PHP4 (and putting this here means that WebStart.php and GlobalSettings.php
* no longer need to be).
*
* Make a self-link
*
* @param string $text text displayed on the link
- * @param array $query associative array of paramter to be in the query string
+ * @param array $query associative array of parameter to be in the query string
* @param string $type value of the "rel" attribute
*
* @return String: HTML fragment
protected function getExtraSortFields() { return array(); }
/**
- * Return the default sorting direction: false for ascending, true for de-
- * scending. You can also have an associative array of ordertype => dir,
+ * Return the default sorting direction: false for ascending, true for
+ * descending. You can also have an associative array of ordertype => dir,
* if multiple order types are supported. In this case getIndexField()
* must return an array, and the keys of that must exactly match the keys
* of this.
/**
* If this supports multiple order type messages, give the message key for
- * enabling each one in getNavigationBar. The return type is an associa-
- * tive array whose keys must exactly match the keys of the array returned
+ * enabling each one in getNavigationBar. The return type is an associative
+ * array whose keys must exactly match the keys of the array returned
* by getIndexField(), and whose values are message keys.
*
* @return Array
<?php
/**
- * Form to edit user perferences.
+ * Form to edit user preferences.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* @param $search String
* @param $limit Integer
- * @param array $namespaces used if query is not explicitely prefixed
+ * @param array $namespaces used if query is not explicitly prefixed
* @return Array of strings
*/
public static function titleSearch( $search, $limit, $namespaces = array() ) {
}
/**
- * Checks if an IP is a trusted proxy providor.
- * Useful to tell if X-Fowarded-For data is possibly bogus.
+ * Checks if an IP is a trusted proxy provider.
+ * Useful to tell if X-Forwarded-For data is possibly bogus.
* Squid cache servers for the site are whitelisted.
*
* @param $ip String
/**
* For back-compat, subclasses may return a raw SQL query here, as a string.
- * This is stronly deprecated; getQueryInfo() should be overridden instead.
+ * This is strongly deprecated; getQueryInfo() should be overridden instead.
* @throws MWException
* @return string
*/
}
/**
- * Sometime we dont want to build rss / atom feeds.
+ * Sometime we don't want to build rss / atom feeds.
*
* @return Boolean
*/
}
/**
- * Remove newlines, carriage returns and decode html entites
+ * Remove newlines, carriage returns and decode html entities
* @param $text String
* @return String
*/
}
/**
- * Return the value of a select() page conds array for the paeg table.
+ * Return the value of a select() page conds array for the page table.
* This will assure that the revision(s) are not orphaned from live pages.
* @since 1.19
* @return Array
}
/**
- * Get the date, formatted in user's languae
+ * Get the date, formatted in user's language
* @return String
*/
public function formatDate() {
}
/**
- * Get the time, formatted in user's languae
+ * Get the time, formatted in user's language
* @return String
*/
public function formatTime() {
wfProfileIn( __METHOD__ );
// Base our staticInitialised variable off of the global config state so that if the globals
- // are changed (like in the secrewed up test system) we will re-initialise the settings.
+ // are changed (like in the screwed up test system) we will re-initialise the settings.
$globalContext = implode( '-', compact( 'wgHtml5', 'wgAllowMicrodataAttributes', 'wgAllowImageTag' ) );
if ( !$staticInitialised || $staticInitialised != $globalContext ) {
isset( $htmlpairs[$t] ) ) {
$badtag = true;
} elseif ( isset( $htmlsingleonly[$t] ) ) {
- # Hack to force empty tag for uncloseable elements
+ # Hack to force empty tag for unclosable elements
$brace = '/>';
} elseif ( isset( $htmlsingle[$t] ) ) {
# Hack to not close $htmlsingle tags
*
* - Discards attributes not on a whitelist for the given element
* - Unsafe style attributes are discarded
- * - Invalid id attributes are reencoded
+ * - Invalid id attributes are re-encoded
*
* @param $attribs Array
* @param $element String
*
* - Discards attributes not the given whitelist
* - Unsafe style attributes are discarded
- * - Invalid id attributes are reencoded
+ * - Invalid id attributes are re-encoded
*
* @param $attribs Array
* @param array $whitelist list of allowed attribute names
}
/**
- * Given HTML input, escape with htmlspecialchars but un-escape entites.
+ * Given HTML input, escape with htmlspecialchars but un-escape entities.
* This allows (generally harmless) entities like   to survive.
*
* @param string $html to escape
}
if ( $wgHtml5 && $wgAllowMicrodataAttributes ) {
- # add HTML5 microdata tages as pecified by http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#the-microdata-model
+ # add HTML5 microdata tags as specified by http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#the-microdata-model
$common = array_merge( $common, array(
'itemid', 'itemprop', 'itemref', 'itemscope', 'itemtype'
) );
}
$testIncludes = array(); // array containing all the includes needed for this test
- $testGlobalConfigs = array(); // an array containg all the global configs needed for this test
+ $testGlobalConfigs = array(); // an array containing all the global configs needed for this test
$testResourceFiles = array(); // an array containing all the resource files needed for this test
$callback = $wgSeleniumTestConfigs[$setupTestSuiteName];
call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles));
}
$testIncludes = array(); // array containing all the includes needed for this test
- $testGlobalConfigs = array(); // an array containg all the global configs needed for this test
+ $testGlobalConfigs = array(); // an array containing all the global configs needed for this test
$testResourceFiles = array(); // an array containing all the resource files needed for this test
$callback = $wgSeleniumTestConfigs[$testSuiteName];
call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles));
require_once( "{$wgStyleDirectory}/{$skinName}.php" );
}
- # Check if we got if not failback to default skin
+ # Check if we got if not fallback to default skin
if ( !MWInit::classExists( $className ) ) {
# DO NOT die if the class isn't found. This breaks maintenance
# scripts and can cause a user account to be unrecoverable
}
/**
- * Render the array as a serie of links.
+ * Render the array as a series of links.
* @param array $tree categories tree returned by Title::getParentCategoryTree
* @return String separated by >, terminate with "\n"
*/
}
/**
- * Renders a $wgFooterIcons icon acording to the method's arguments
+ * Renders a $wgFooterIcons icon according to the method's arguments
* @param array $icon The icon to build the html for, see $wgFooterIcons for the format of this array
* @param bool|String $withImage Whether to use the icon's image or output a text-only footericon
* @return String HTML
}
/**
- * Return a fully resolved style path url to images or styles stored in the curent skins's folder.
+ * Return a fully resolved style path url to images or styles stored in the current skins's folder.
* This method returns a url resolved using the configured skin style path
* and includes the style version inside of the url.
* @param string $name The name or path of a skin resource file
}
/**
- * Output a boolean indiciating if buildPersonalUrls should output separate
+ * Output a boolean indicating if buildPersonalUrls should output separate
* login and create account links or output a combined link
* By default we simply return a global config setting that affects most skins
* This is setup as a method so that like with $wgLogo and getLogo() a skin
* variants: Used to list the language variants for the page
*
* Each section's value is a key/value array of links for that section.
- * The links themseves have these common keys:
+ * The links themselves have these common keys:
* - class: The css classes to apply to the tab
* - text: The text to display on the tab
* - href: The href for the tab to point to
# 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 su-
- # perfluous and conflicts with an accesskey (Ctrl-E) often
+ # 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 ( in_array( $action, array( 'edit', 'submit' ) ) ) {
if ( isset( $content_navigation['views']['edit'] ) ) {
/**
* Create an array of common toolbox items from the data in the quicktemplate
* stored by SkinTemplate.
- * The resulting array is built acording to a format intended to be passed
+ * The resulting array is built according to a format intended to be passed
* through makeListItem to generate the html.
* @return array
*/
/**
* Create an array of personal tools items from the data in the quicktemplate
* stored by SkinTemplate.
- * The resulting array is built acording to a format intended to be passed
+ * The resulting array is built according to a format intended to be passed
* through makeListItem to generate the html.
* This is in reality the same list as already stored in personal_urls
* however it is reformatted so that you can just pass the individual items
/**
* Outputs a summary message on top of special pages
* Per default the message key is the canonical name of the special page
- * May be overriden, i.e. by extensions to stick with the naming conventions
+ * May be overridden, i.e. by extensions to stick with the naming conventions
* for message keys: 'extensionname-xxx'
*
* @param string $summaryMessageKey message key of the summary
// RequestContext passes context to wfMessage, and the language is set from
// the context, but setting the language for Message class removes the
// interface message status, which breaks for example usernameless gender
- // invokations. Restore the flag when not including special page in content.
+ // invocations. Restore the flag when not including special page in content.
if ( $this->including() ) {
$message->setInterfaceMessageFlag( false );
}
$name = $this->getName();
$group = '-';
- // Allow overridding the group from the wiki side
+ // Allow overbidding the group from the wiki side
$msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage();
if ( !$msg->isBlank() ) {
$group = $msg->text();
$group = $this->getGroupName();
// Group '-' is used as default to have the chance to determine,
- // if the special pages overriddes this method,
+ // if the special pages overrides this method,
// if not overridden, $wgSpecialPageGroups is checked for b/c
if ( $group === '-' && isset( $wgSpecialPageGroups[$name] ) ) {
$group = $wgSpecialPageGroups[$name];
// Query parameters that can be passed through redirects
protected $mAllowedRedirectParams = array();
- // Query parameteres added by redirects
+ // Query parameters added by redirects
protected $mAddedRedirectParams = array();
public function execute( $par ) {
}
/**
* SpecialMypage, SpecialMytalk and SpecialMycontributions special pages
- * are used to get user independant links pointing to the user page, talk
+ * are used to get user independent links pointing to the user page, talk
* page and list of contributions.
* This can let us cache a single copy of any generated content for all
* users.
/**
* Initialise and return the list of special page aliases. Returns an object with
* properties which can be accessed $obj->pagename - each property is an array of
- * aliases; the first in the array is the cannonical alias. All registered special
+ * aliases; the first in the array is the canonical alias. All registered special
* pages are guaranteed to have a property entry, and for that property array to
* contain at least one entry (English fallbacks will be added if necessary).
* @return Object
static function isUtf8( $value, $disableMbstring = false ) {
if ( preg_match( '/[\x80-\xff]/', $value ) === 0 ) {
- # no high bit set, this is pure ASCII which is defacto
+ # no high bit set, this is pure ASCII which is de facto
# valid UTF-8
return true;
}
/**
* Set an element of the replacement array
* @param $from string
- * @param $to stromg
+ * @param $to string
*/
function setPair( $from, $to ) {
$this->data[$from] = $to;
*
* @param string $global name of the global variable.
* @param string $class name of the class of the real object.
- * @param array $params parameters to pass to contructor of the real
+ * @param array $params parameters to pass to constructor of the real
* object.
*/
function __construct( $global = null, $class = null, $params = array() ) {
}
/**
- * Returns a bool value whetever $obj is a stub object. Can be used to break
+ * Returns a bool value whenever $obj is a stub object. Can be used to break
* a infinite loop when unstubbing an object.
*
* @param $obj Object to check.
* properties, e.g. eval.php
*
* @param string $name name of the method called in this object.
- * @param $level Integer: level to go in the stact trace to get the function
+ * @param $level Integer: level to go in the stack trace to get the function
* who called this function.
* @throws MWException
*/
*
* @param string $text the link text; spaces, prefixes, and an
* initial ':' indicating the main namespace are accepted.
- * @param int $defaultNamespace the namespace to use if none is speci-
- * fied by a prefix. If you want to force a specific namespace even if
+ * @param int $defaultNamespace the namespace to use if none is specified
+ * by a prefix. If you want to force a specific namespace even if
* $text might begin with a namespace prefix, use makeTitle() or
* makeTitleSafe().
* @throws MWException
* is either NS_USER or NS_USER_TALK since both of them have NS_USER
* as their subject namespace.
*
- * This is MUCH simpler than individually testing for equivilance
+ * This is MUCH simpler than individually testing for equivalence
* against both NS_USER and NS_USER_TALK, and is also forward compatible.
* @since 1.19
* @param $ns int
* Is this the mainpage?
* @note Title::newFromText seems to be sufficiently optimized by the title
* cache that we don't need to over-optimize by doing direct comparisons and
- * acidentally creating new bugs where $title->equals( Title::newFromText() )
+ * accidentally creating new bugs where $title->equals( Title::newFromText() )
* ends up reporting something differently than $title->isMainPage();
*
* @since 1.18
|| $this->hasContentModel( CONTENT_MODEL_JAVASCRIPT ) );
#NOTE: this hook is also called in ContentHandler::getDefaultModel. It's called here again to make sure
- # hook funktions can force this method to return true even outside the mediawiki namespace.
+ # hook functions can force this method to return true even outside the mediawiki namespace.
wfRunHooks( 'TitleIsCssOrJsPage', array( $this, &$isCssOrJsPage ) );
* second argument named variant. This was deprecated in favor
* of passing an array of option with a "variant" key
* Once $query2 is removed for good, this helper can be dropped
- * andthe wfArrayToCgi moved to getLocalURL();
+ * and the wfArrayToCgi moved to getLocalURL();
*
* @since 1.19 (r105919)
* @param $query
}
/**
- * Check that the user isn't blocked from editting.
+ * Check that the user isn't blocked from editing.
*
* @param string $action the action to check
* @param $user User to check
/**
* Updates page_touched for this page; called from LinksUpdate.php
*
- * @return Bool true if the update succeded
+ * @return Bool true if the update succeeded
*/
public function invalidateCache() {
global $wgMemc;
global $wgContLang;
// Gets the subject namespace if this title
$namespace = MWNamespace::getSubject( $this->getNamespace() );
- // Checks if cononical namespace name exists for namespace
+ // Checks if canonical namespace name exists for namespace
if ( MWNamespace::exists( $this->getNamespace() ) ) {
// Uses canonical namespace name
$namespaceKey = MWNamespace::getCanonicalName( $namespace );
public function isValidRedirectTarget() {
global $wgInvalidRedirectTargets;
- // invalid redirect targets are stored in a global array, but explicity disallow Userlogout here
+ // invalid redirect targets are stored in a global array, but explicitly disallow Userlogout here
if ( $this->isSpecial( 'Userlogout' ) ) {
return false;
}
* Classes to walk into a list of Title objects.
*
* Note: this entire file is a byte-for-byte copy of UserArray.php with
- * s/User/Title/. If anyone can figure out how to do this nicely with inheri-
- * tance or something, please do so.
+ * s/User/Title/. If anyone can figure out how to do this nicely with
+ * inheritance or something, please do so.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/** @var Array */
protected $fileHandles = array(); // cache file handles
- const QUICK_RAND = 1; // get randomness from fast and unsecure sources
+ const QUICK_RAND = 1; // get randomness from fast and insecure sources
protected function __construct() {
$idFile = wfTempDir() . '/mw-' . __CLASS__ . '-UID-nodeid';
}
/**
- * @param array $info (UIDGenerator::milltime(), counter, clock sequence)
+ * @param array $info (UIDGenerator::millitime(), counter, clock sequence)
* @return string 128 bits
*/
protected function getTimestampedID128( array $info ) {
* Create a new user object using data from session or cookies. If the
* login credentials are invalid, the result is an anonymous user.
*
- * @param $request WebRequest object to use; $wgRequest will be used if
- * ommited.
+ * @param $request WebRequest object to use; $wgRequest will be used if omitted.
* @return User object
*/
public static function newFromSession( WebRequest $request = null ) {
* Is the input a valid username?
*
* Checks if the input is a valid username, we don't want an empty string,
- * an IP address, anything that containins slashes (would mess up subpages),
+ * an IP address, anything that contains slashes (would mess up subpages),
* is longer than the maximum allowed username size or doesn't begin with
* a capital letter.
*
/**
* Check if user is blocked on all wikis.
* Do not use for actual edit permission checks!
- * This is intented for quick UI checks.
+ * This is intended for quick UI checks.
*
* @param string $ip IP address, uses current client if none given
* @return Bool True if blocked, false otherwise
* address for an anonymous user to something other than the current
* remote IP.
*
- * @note User::newFromName() has rougly the same function, when the named user
+ * @note User::newFromName() has roughly the same function, when the named user
* does not exist.
* @param string $str New user name to set
*/
* Generate a looking random token for various uses.
*
* @return String The new random token
- * @deprecated since 1.20; Use MWCryptRand for secure purposes or wfRandomString for pesudo-randomness
+ * @deprecated since 1.20; Use MWCryptRand for secure purposes or wfRandomString for pseudo-randomness
*/
public static function generateToken() {
return MWCryptRand::generateHex( 32 );
if ( is_array( $body ) ) {
// we are sending a multipart message
- wfDebug( "Assembling mulitpart mime email\n" );
+ wfDebug( "Assembling multipart mime email\n" );
if ( !stream_resolve_include_path( 'Mail/mime.php' ) ) {
wfDebug( "PEAR Mail_Mime package is not installed. Falling back to text email.\n" );
}
return;
}
- // Build a list of users to notfiy
+ // Build a list of users to notify
$watchers = array();
if ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) {
$dbw = wfGetDB( DB_MASTER );
<?php
/**
- * Deal with importing all those nasssty globals and things
+ * Deal with importing all those nasty globals and things
*
* Copyright © 2003 Brion Vibber <brion@pobox.com>
* http://www.mediawiki.org/
*/
public function getCheck( $name ) {
# Checkboxes and buttons are only present when clicked
- # Presence connotes truth, abscense false
+ # Presence connotes truth, absence false
return $this->getVal( $name, null ) !== null;
}
}
}
-# bug 15461: Make IE8 turn off content sniffing. Everbody else should ignore this
+# bug 15461: Make IE8 turn off content sniffing. Everybody else should ignore this
# We're adding it here so that it's *always* set, even for alternate entry
# points and when $wgOut gets disabled or overridden.
header( 'X-Content-Type-Options: nosniff' );
$data = $this->pageDataFromTitle( wfGetDB( DB_MASTER ), $this->mTitle );
} elseif ( $from === self::READ_NORMAL ) {
$data = $this->pageDataFromTitle( wfGetDB( DB_SLAVE ), $this->mTitle );
- // Use a "last rev inserted" timestamp key to dimish the issue of slave lag.
+ // Use a "last rev inserted" timestamp key to diminish the issue of slave lag.
// Note that DB also stores the master position in the session and checks it.
$touched = $this->getCachedLastEditTime();
if ( $touched ) { // key set
$changed = true;
}
- // If nothing's changed, do nothing
+ // If nothing has changed, do nothing
if ( !$changed ) {
return Status::newGood();
}
* performs permissions checks on $user, then calls commitRollback()
* to do the dirty work
*
- * @todo: seperate the business/permission stuff out from backend code
+ * @todo: separate the business/permission stuff out from backend code
*
* @param string $fromP Name of the user whose edits to rollback.
* @param string $summary Custom summary. Set to default summary if empty.
* Convenience function to build an HTML form label
* @param string $label text of the label
* @param $id
- * @param array $attribs an attribute array. This will usuall be
+ * @param array $attribs an attribute array. This will usually be
* the same array as is passed to the corresponding input element,
* so this function will cherry-pick appropriate attributes to
* apply to the label as well; only class and title are applied.
}
/**
- * Establish conncetion
+ * Establish connection
*
* @access private
*
* of length self::SEGSIZE. The result is cached. This is a helper function
* for getBlock().
*
- * If there are not enough bytes in the file to satsify the request, the
+ * If there are not enough bytes in the file to satisfy the request, the
* return value will be truncated. If a request is made for a segment beyond
* the end of the file, an empty string will be returned.
* @return string
public function getExamples() {
return array(
- 'api.php?action=move&from=Exampel&to=Example&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect='
+ 'api.php?action=move&from=Badtitle&to=Goodtitle&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect='
);
}
}
public function getDescription() {
- return 'Returns all external urls (not interwikies) from the given page(s)';
+ return 'Returns all external urls (not interwikis) from the given page(s)';
}
public function getPossibleErrors() {
<?php
/**
- * This file contains database-related utiliy classes.
+ * This file contains database-related utility classes.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* (http://citeseer.ist.psu.edu/myers86ond.html) with range compression (see Wu et al.'s
* "An O(NP) Sequence Comparison Algorithm").
*
- * This implementation supports an upper bound on the excution time.
+ * This implementation supports an upper bound on the execution time.
*
* Complexity: O((M + N)D) worst case time, O(M + N + D^2) expected time, O(M + N) space
*
* Constructor class for key/value blob data kept in external repositories.
*
* Objects in external stores are defined by a special URL. The URL is of
- * the form "<store protocal>://<location>/<object name>". The protocal is used
+ * the form "<store protocol>://<location>/<object name>". The protocol is used
* to determine what ExternalStoreMedium class is used. The location identifies
* particular storage instances or database clusters for store class to use.
*
* When an object is inserted into a store, the calling code uses a partial URL of
- * the form "<store protocal>://<location>" and receives the full object URL on success.
+ * the form "<store protocol>://<location>" and receives the full object URL on success.
* This is useful since object names can be sequential IDs, UUIDs, or hashes.
* Callers are not responsible for unique name generation.
*
<?php
/**
- * Installer-specific wikitext formating.
+ * Installer-specific wikitext formatting.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
The aggregators are used by nextJobDB.php, which is a script that will return a
random ready queue (on any wiki in the farm) that can be used with runJobs.php.
-This can be used in conjuction with any scripts that handle wiki farm job queues.
+This can be used in conjunction with any scripts that handle wiki farm job queues.
Note that $wgLocalDatabases defines what wikis are in the wiki farm.
Since each job type has its own queue, and wiki-farms may have many wikis,
<?php
/**
- * Simple wrapper for json_econde and json_decode that falls back on Services_JSON class.
+ * Simple wrapper for json_encode and json_decode that falls back on Services_JSON class.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* // create a new instance of Services_JSON
* $json = new Services_JSON();
*
- * // convert a complexe value to JSON notation, and send it to the browser
+ * // convert a complex value to JSON notation, and send it to the browser
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
* $output = $json->encode($value);
*
*
* Normally should be handled by mb_convert_encoding, but
* provides a slower PHP-only method for installations
- * that lack the multibye string extension.
+ * that lack the multibyte string extension.
*
* @param string $utf16 UTF-16 character
* @return String: UTF-8 character
*
* Normally should be handled by mb_convert_encoding, but
* provides a slower PHP-only method for installations
- * that lack the multibye string extension.
+ * that lack the multibyte string extension.
*
* @param string $utf8 UTF-8 character
* @return String: UTF-16 character
*
* @param $var Mixed: any number, boolean, string, array, or object to be encoded.
* see argument 1 to Services_JSON() above for array-parsing behavior.
- * if var is a strng, note that encode() always expects it
+ * if var is a string, note that encode() always expects it
* to be in ASCII or UTF-8 format!
* @param $pretty Boolean: pretty-print output with indents and newlines
*
*
* @param $var Mixed: any number, boolean, string, array, or object to be encoded.
* see argument 1 to Services_JSON() above for array-parsing behavior.
- * if var is a strng, note that encode() always expects it
+ * if var is a string, note that encode() always expects it
* to be in ASCII or UTF-8 format!
*
* @return mixed JSON string representation of input var or an error if a problem occurs
}
elseif ($type == KEYWORD_VAR && $type == $lastType)
{
- // mutiple var-statements can go into one
+ // multiple var-statements can go into one
$t = ',' . substr($t, 4);
}
else
if ($elsePart)
{
- // be carefull and always make a block out of the thenPart; could be more optimized but is a lot of trouble
+ // be careful and always make a block out of the thenPart; could be more optimized but is a lot of trouble
if ($thenPart != ';' && $thenPart[0] != '{')
$thenPart = '{' . $thenPart . '}';
break;
case TOKEN_STRING:
- //combine concatted strings with same quotestyle
+ //combine concatenated strings with same quote style
if ($n->type == OP_PLUS && substr($left, -1) == $right[0])
{
$s = substr($left, 0, -1) . substr($right, 1);
<?php
/**
- * Formating of image metadata values into human readable form.
+ * Formatting of image metadata values into human readable form.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Class for reading jpegs and extracting metadata.
* see also BitmapMetadataHandler.
*
- * Based somewhat on GIFMetadataExtrator.
+ * Based somewhat on GIFMetadataExtractor.
*
* @ingroup Media
*/
# Explicitly using Unicode 6.0
BASE=http://www.unicode.org/Public/6.0.0/ucd
-# Can override to php-cli or php5 or whatevah
+# Can override to php-cli or php5 or whatever
PHP=php
#PHP=php-cli
*
* Not as fast as I'd like, but should be usable for most purposes.
* UtfNormal::toNFC() will bail early if given ASCII text or text
- * it can quickly deterimine is already normalized.
+ * it can quickly determine is already normalized.
*
* All functions can be called static.
*
if ( $params['persistent'] ) {
// The pool ID must be unique to the server/option combination.
// The Memcached object is essentially shared for each pool ID.
- // We can only resuse a pool ID if we keep the config consistent.
+ // We can only reuse a pool ID if we keep the config consistent.
$this->client = new Memcached( md5( serialize( $params ) ) );
if ( count( $this->client->getServerList() ) ) {
wfDebug( __METHOD__ . ": persistent Memcached object already loaded.\n" );
*/
/**
- * Date formatter, recognises dates in plain text and formats them accoding to user preferences.
+ * Date formatter, recognises dates in plain text and formats them according to user preferences.
* @todo preferences, OutputPage
* @ingroup Parser
*/
}
/**
- * Set this module's origin. This is called by ResourceLodaer::register()
+ * Set this module's origin. This is called by ResourceLoader::register()
* when registering the module. Other code should not call this.
*
* @param int $origin origin
if( $ns == NS_CATEGORY && !$showlinkedto ) {
// special handling for categories
- // XXX: should try to make this less klugy
+ // XXX: should try to make this less kludgy
$link_tables = array( 'categorylinks' );
$showlinkedto = true;
} else {
/**
* Returns true if the user can use this upload module or else a string
* identifying the missing permission.
- * Can be overriden by subclasses.
+ * Can be overridden by subclasses.
*
* @param $user User
* @return bool
$repo = RepoGroup::singleton()->getLocalRepo();
if ( $repo->isVirtualUrl( $srcPath ) ) {
// @TODO: just make uploads work with storage paths
- // UploadFromStash loads files via virtuals URLs
+ // UploadFromStash loads files via virtual URLs
$tmpFile = $repo->getLocalCopy( $srcPath );
$tmpFile->bind( $this ); // keep alive with $this
wfProfileOut( __METHOD__ );
$chunk = trim( $chunk );
- # @todo FIXME: Convert from UTF-16 if necessarry!
+ # @todo FIXME: Convert from UTF-16 if necessary!
wfDebug( __METHOD__ . ": checking for embedded scripts and HTML stuff\n" );
# check for HTML doctype
return true;
}
- # href with embeded svg as target
+ # href with embedded svg as target
if( $stripped == 'href' && preg_match( '!data:[^,]*image/svg[^,]*,!sim', $value ) ) {
wfDebug( __METHOD__ . ": Found href to embedded svg \"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
return true;
}
- # href with embeded (text/xml) svg as target
+ # href with embedded (text/xml) svg as target
if( $stripped == 'href' && preg_match( '!data:[^,]*text/xml[^,]*,!sim', $value ) ) {
wfDebug( __METHOD__ . ": Found href to embedded svg \"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
return true;
# use set to add href attribute to parent element
if( $strippedElement == 'set' && $stripped == 'attributename' && strpos( $value, 'href' ) !== false ) {
- wfDebug( __METHOD__ . ": Found svg setting href attibute '$value' in uploaded file.\n" );
+ wfDebug( __METHOD__ . ": Found svg setting href attribute '$value' in uploaded file.\n" );
return true;
}
# use set to add a remote / data / script target to an element
if( $strippedElement == 'set' && $stripped == 'to' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
- wfDebug( __METHOD__ . ": Found svg setting attibute to '$value' in uploaded file.\n" );
+ wfDebug( __METHOD__ . ": Found svg setting attribute to '$value' in uploaded file.\n" );
return true;
}
$similarFiles = RepoGroup::singleton()->getLocalRepo()->findFilesByPrefix(
"{$partname}.", 1 );
if ( count( $similarFiles ) ) {
- return array(\r
- 'warning' => 'exists-normalized',\r
- 'file' => $file,\r
- 'normalizedFile' => $similarFiles[0],\r
+ return array(
+ 'warning' => 'exists-normalized',
+ 'file' => $file,
+ 'normalizedFile' => $similarFiles[0],
);
}