$attr['id'] = $this->mID;
$attr['name'] = $this->mName;
- $attr += $this->getAttributes( array( 'disabled', 'tabindex' ), array( 'tabindex' => 'tabIndex' ) );
+ $attr += $this->getAttributes(
+ array( 'disabled', 'tabindex' ),
+ array( 'tabindex' => 'tabIndex' )
+ );
if ( $this->mClass !== '' ) {
$attr['classes'] = array( $this->mClass );
$html = Xml::fieldset( $legend, $html );
}
- return Html::rawElement( 'form', $this->getFormAttributes() + array( 'class' => 'visualClear' ), $html );
+ return Html::rawElement(
+ 'form',
+ $this->getFormAttributes() + array( 'class' => 'visualClear' ),
+ $html
+ );
}
/**
* Returns the given attributes from the parameters
*
* @param array $list List of attributes to get
- * @param array $mappings Optional - Key/value map of attribute names to use instead of the ones passed in
+ * @param array $mappings Optional - Key/value map of attribute names to use
+ * instead of the ones passed in.
* @return array Attributes
*/
public function getAttributes( array $list, array $mappings = null ) {
}
$text = $title->getPrefixedText();
- if ( $this->mParams['namespace'] !== false && !$title->inNamespace( $this->mParams['namespace'] ) ) {
+ if ( $this->mParams['namespace'] !== false &&
+ !$title->inNamespace( $this->mParams['namespace'] )
+ ) {
return $this->msg( 'htmlform-title-badnamespace', $this->mParams['namespace'], $text )->parse();
}
*/
protected $displayFormat = 'ooui';
- public static function loadInputFromParameters( $fieldname, $descriptor, HTMLForm $parent = null ) {
+ public static function loadInputFromParameters( $fieldname, $descriptor,
+ HTMLForm $parent = null
+ ) {
$field = parent::loadInputFromParameters( $fieldname, $descriptor, $parent );
$field->setShowEmptyLabel( false );
return $field;
return true;
}
- public static function loadInputFromParameters( $fieldname, $descriptor, HTMLForm $parent = null ) {
+ public static function loadInputFromParameters( $fieldname, $descriptor,
+ HTMLForm $parent = null
+ ) {
$field = parent::loadInputFromParameters( $fieldname, $descriptor, $parent );
$field->setShowEmptyLabel( false );
return $field;
function submitConnectForm() {
// Get variables from the request
- $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', 'wgDBname', 'wgDBmwschema' ) );
+ $newValues = $this->setVarsFromRequest( array(
+ 'wgDBserver',
+ 'wgDBport',
+ 'wgDBname',
+ 'wgDBmwschema'
+ ) );
// Validate them
$status = Status::newGood();
array( 'addPgIndex', 'recentchanges', 'rc_timestamp_bot', '(rc_timestamp) WHERE rc_bot = 0' ),
array( 'addPgIndex', 'templatelinks', 'templatelinks_from', '(tl_from)' ),
array( 'addPgIndex', 'watchlist', 'wl_user', '(wl_user)' ),
- array( 'addPgIndex', 'watchlist', 'wl_user_notificationtimestamp', '(wl_user, wl_notificationtimestamp)' ),
+ array( 'addPgIndex', 'watchlist', 'wl_user_notificationtimestamp',
+ '(wl_user, wl_notificationtimestamp)' ),
array( 'addPgIndex', 'logging', 'logging_user_type_time',
'(log_user, log_type, log_timestamp)' ),
array( 'addPgIndex', 'logging', 'logging_page_id_time', '(log_page,log_timestamp)' ),
$this->output( "...bug 66650 already fixed or not applicable.\n" );
return true;
};
- $this->applyPatch( 'patch-textsearch_bug66650.sql', false, "Rebuilding text search for bug 66650" );
+ $this->applyPatch( 'patch-textsearch_bug66650.sql', false,
+ 'Rebuilding text search for bug 66650' );
}
}
// 1.24
array( 'addField', 'page_props', 'pp_sortkey', 'patch-pp_sortkey.sql' ),
array( 'dropField', 'recentchanges', 'rc_cur_time', 'patch-drop-rc_cur_time.sql' ),
- array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', 'patch-watchlist-user-notificationtimestamp-index.sql' ),
+ array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp',
+ 'patch-watchlist-user-notificationtimestamp-index.sql' ),
array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql' ),
array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ),
array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ),
* var: The variable to be configured (required)
* label: The message name for the label (required)
* itemLabelPrefix: The message name prefix for the item labels (required)
- * itemLabels: List of message names to use for the item labels instead of itemLabelPrefix, keyed by values
+ * itemLabels: List of message names to use for the item labels instead
+ * of itemLabelPrefix, keyed by values
* values: List of allowed values (required)
* itemAttribs: Array of attribute arrays, outer key is the value name (optional)
* commonAttribs: Attribute array applied to all items
if ( $status === 200 || $status === 301 || $status === 302 || $status === 400 ) {
return true;
} elseif ( $status ) {
- $this->setLastError( __METHOD__ . ': incorrect HTTP status ' . $status . ' when hitting ' . $thumbUrl );
+ $this->setLastError( __METHOD__ . ': incorrect HTTP status ' .
+ $status . ' when hitting ' . $thumbUrl );
return false;
} else {
$this->setLastError( __METHOD__ . ': HTTP request failure' );
return false;
}
} else {
- $this->setLastError( __METHOD__ . ': unknown thumbnail render method ' . $wgUploadThumbnailRenderMethod );
+ $this->setLastError( __METHOD__ . ': unknown thumbnail render method ' .
+ $wgUploadThumbnailRenderMethod );
return false;
}
} else {
}
}
- # Using the (log_namespace, log_title, log_timestamp) index with a
- # range scan (LIKE) on the first two parts, instead of simple equality,
- # makes it unusable for sorting. Sorted retrieval using another index
- # would be possible, but then we might have to scan arbitrarily many
- # nodes of that index. Therefore, we need to avoid this if $wgMiserMode
- # is on.
- #
- # This is not a problem with simple title matches, because then we can
- # use the page_time index. That should have no more than a few hundred
- # log entries for even the busiest pages, so it can be safely scanned
- # in full to satisfy an impossible condition on user or similar.
+ /**
+ * Using the (log_namespace, log_title, log_timestamp) index with a
+ * range scan (LIKE) on the first two parts, instead of simple equality,
+ * makes it unusable for sorting. Sorted retrieval using another index
+ * would be possible, but then we might have to scan arbitrarily many
+ * nodes of that index. Therefore, we need to avoid this if $wgMiserMode
+ * is on.
+ *
+ * This is not a problem with simple title matches, because then we can
+ * use the page_time index. That should have no more than a few hundred
+ * log entries for even the busiest pages, so it can be safely scanned
+ * in full to satisfy an impossible condition on user or similar.
+ */
$this->mConds['log_namespace'] = $ns;
if ( $doUserRightsLogLike ) {
$params = array( $name . $wgUserrightsInterwikiDelimiter );
$watchers = self::updateWatchlistTimestamp( $editor, $title, $timestamp );
$sendEmail = true;
+ // $watchers deals with $wgEnotifWatchlist.
// If nobody is watching the page, and there are no users notified on all changes
// don't bother creating a job/trying to send emails, unless it's a
// talk page with an applicable notification.
- //
- // $watchers deals with $wgEnotifWatchlist
if ( !count( $watchers ) && !count( $wgUsersNotifiedOnAllChanges ) ) {
$sendEmail = false;
// Only send notification for non minor edits, unless $wgEnotifMinorEdits
return Status::newFatal( 'user-mail-no-addy' );
}
- // Forge email headers
- // -------------------
- //
- // WARNING
- //
- // DO NOT add To: or Subject: headers at this step. They need to be
- // handled differently depending upon the mailer we are going to use.
- //
- // To:
- // PHP mail() first argument is the mail receiver. The argument is
- // used as a recipient destination and as a To header.
- //
- // PEAR mailer has a recipient argument which is only used to
- // send the mail. If no To header is given, PEAR will set it to
- // to 'undisclosed-recipients:'.
- //
- // NOTE: To: is for presentation, the actual recipient is specified
- // by the mailer using the Rcpt-To: header.
- //
- // Subject:
- // PHP mail() second argument to pass the subject, passing a Subject
- // as an additional header will result in a duplicate header.
- //
- // PEAR mailer should be passed a Subject header.
- //
- // -- hashar 20120218
+ /**
+ * Forge email headers
+ * -------------------
+ *
+ * WARNING
+ *
+ * DO NOT add To: or Subject: headers at this step. They need to be
+ * handled differently depending upon the mailer we are going to use.
+ *
+ * To:
+ * PHP mail() first argument is the mail receiver. The argument is
+ * used as a recipient destination and as a To header.
+ *
+ * PEAR mailer has a recipient argument which is only used to
+ * send the mail. If no To header is given, PEAR will set it to
+ * to 'undisclosed-recipients:'.
+ *
+ * NOTE: To: is for presentation, the actual recipient is specified
+ * by the mailer using the Rcpt-To: header.
+ *
+ * Subject:
+ * PHP mail() second argument to pass the subject, passing a Subject
+ * as an additional header will result in a duplicate header.
+ *
+ * PEAR mailer should be passed a Subject header.
+ *
+ * -- hashar 20120218
+ */
$headers['From'] = $from->toString();
$returnPath = $from->address;
MediaWiki\restoreWarnings();
return Status::newGood();
} else {
- //
// PHP mail()
- //
if ( count( $to ) > 1 ) {
$headers['To'] = 'undisclosed-recipients:;';
}
*/
protected function transformGd( $image, $params ) {
# Use PHP's builtin GD library functions.
- #
# First find out what kind of file this is, and select the correct
# input routine for this.
$binaryHeader = fread( $f, 26 );
fclose( $f );
- # Master image structure:
- #
- # byte[9] "gimp xcf " File type magic
- # byte[4] version XCF version
- # "file" - version 0
- # "v001" - version 1
- # "v002" - version 2
- # byte 0 Zero-terminator for version tag
- # uint32 width With of canvas
- # uint32 height Height of canvas
- # uint32 base_type Color mode of the image; one of
- # 0: RGB color
- # 1: Grayscale
- # 2: Indexed color
- # (enum GimpImageBaseType in libgimpbase/gimpbaseenums.h)
+ /**
+ * Master image structure:
+ *
+ * byte[9] "gimp xcf " File type magic
+ * byte[4] version XCF version
+ * "file" - version 0
+ * "v001" - version 1
+ * "v002" - version 2
+ * byte 0 Zero-terminator for version tag
+ * uint32 width With of canvas
+ * uint32 height Height of canvas
+ * uint32 base_type Color mode of the image; one of
+ * 0: RGB color
+ * 1: Grayscale
+ * 2: Indexed color
+ * (enum GimpImageBaseType in libgimpbase/gimpbaseenums.h)
+ */
try {
$header = wfUnpack(
"A9magic" . # A: space padded
// immediately following the StandardXMP. However, the JPEG standard
// does not require preservation of marker segment order. A robust JPEG
// reader should tolerate the marker segments in any order."
- //
- // otoh the probability that an image will have more than 128k of
- // metadata is rather low... so the probability that it will have
+ // On the other hand, the probability that an image will have more than
+ // 128k of metadata is rather low... so the probability that it will have
// > 128k, and be in the wrong order is very low...
if ( $len['offset'] !== $this->extendedXMPOffset ) {
// In practise I have yet to see a file that
// uses this element, however it is mentioned
// on page 25 of part 1 of the xmp standard.
- //
- // also it seems as if exiv2 and exiftool do not support
+ // Also it seems as if exiv2 and exiftool do not support
// this either (That or I misunderstand the standard)
$this->logger->info( __METHOD__ . ' Encountered <rdf:type> which isn\'t currently supported' );
}
if ( $rt->isExternal() ) {
if ( $rt->isLocal() ) {
// Offsite wikis need an HTTP redirect.
- //
// This can be hard to reverse and may produce loops,
// so they may be disabled in the site configuration.
$source = $this->mTitle->getFullURL( 'redirect=no' );
if ( $rt->isSpecialPage() ) {
// Gotta handle redirects to special pages differently:
- // Fill the HTTP response "Location" header and ignore
- // the rest of the page we're on.
- //
- // Some pages are not valid targets
+ // Fill the HTTP response "Location" header and ignore the rest of the page we're on.
+ // Some pages are not valid targets.
if ( $rt->isValidRedirectTarget() ) {
return $rt->getFullURL();
} else {
}
$revisionId = $revision->insertOn( $dbw );
- // Update page
- //
+ // Update page.
// We check for conflicts by comparing $oldid with the current latest revision ID.
$ok = $this->updateRevisionOn( $dbw, $revision, $oldid, $oldIsRedirect );
$bitfield = 'rev_deleted';
}
- // For now, shunt the revision data into the archive table.
- // Text is *not* removed from the text table; bulk storage
- // is left intact to avoid breaking block-compression or
- // immutable storage schemes.
- //
- // For backwards compatibility, note that some older archive
- // table entries will have ar_text and ar_flags fields still.
- //
- // In the future, we may keep revisions and mark them with
- // the rev_deleted field, which is reserved for this purpose.
+ /**
+ * For now, shunt the revision data into the archive table.
+ * Text is *not* removed from the text table; bulk storage
+ * is left intact to avoid breaking block-compression or
+ * immutable storage schemes.
+ *
+ * For backwards compatibility, note that some older archive
+ * table entries will have ar_text and ar_flags fields still.
+ *
+ * In the future, we may keep revisions and mark them with
+ * the rev_deleted field, which is reserved for this purpose.
+ */
$row = array(
'ar_namespace' => 'page_namespace',
* @ingroup Parser
*/
class ParserOutput extends CacheTime {
- public $mText, # The output text
- $mLanguageLinks, # List of the full text of language links, in the order they appear
- $mCategories, # Map of category names to sort keys
- $mIndicators = array(), # Page status indicators, usually displayed in top-right corner
- $mTitleText, # title text of the chosen language variant
- $mLinks = array(), # 2-D map of NS/DBK to ID for the links in the document. ID=zero for broken.
- $mTemplates = array(), # 2-D map of NS/DBK to ID for the template references. ID=zero for broken.
- $mTemplateIds = array(), # 2-D map of NS/DBK to rev ID for the template references. ID=zero for broken.
- $mImages = array(), # DB keys of the images used, in the array key only
- $mFileSearchOptions = array(), # DB keys of the images used mapped to sha1 and MW timestamp
- $mExternalLinks = array(), # External link URLs, in the key only
- $mInterwikiLinks = array(), # 2-D map of prefix/DBK (in keys only) for the inline interwiki links in the document.
- $mNewSection = false, # Show a new section link?
- $mHideNewSection = false, # Hide the new section link?
- $mNoGallery = false, # No gallery on category page? (__NOGALLERY__)
- $mHeadItems = array(), # Items to put in the <head> section
- $mModules = array(), # Modules to be loaded by the resource loader
- $mModuleScripts = array(), # Modules of which only the JS will be loaded by the resource loader
- $mModuleStyles = array(), # Modules of which only the CSSS will be loaded by the resource loader
- $mJsConfigVars = array(), # JavaScript config variable for mw.config combined with this page
- $mOutputHooks = array(), # Hook tags as per $wgParserOutputHooks
- $mWarnings = array(), # Warning text to be returned to the user. Wikitext formatted, in the key only
- $mSections = array(), # Table of contents
- $mEditSectionTokens = false, # prefix/suffix markers if edit sections were output as tokens
- $mProperties = array(), # Name/value pairs to be cached in the DB
- $mTOCHTML = '', # HTML of the TOC
- $mTimestamp, # Timestamp of the revision
- $mTOCEnabled = true, # Whether TOC should be shown, can't override __NOTOC__
- $mEnableOOUI = false; # Whether OOUI should be enabled
- private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change.
- private $mAccessedOptions = array(); # List of ParserOptions (stored in the keys)
- private $mExtensionData = array(); # extra data used by extensions
- private $mLimitReportData = array(); # Parser limit report data
- private $mParseStartTime = array(); # Timestamps for getTimeSinceStart()
- private $mPreventClickjacking = false; # Whether to emit X-Frame-Options: DENY
- private $mFlags = array(); # Generic flags
+ /**
+ * @var string $mText The output text
+ */
+ public $mText;
+
+ /**
+ * @var array $mLanguageLinks List of the full text of language links,
+ * in the order they appear.
+ */
+ public $mLanguageLinks;
+
+ /**
+ * @var array $mCategoriesMap of category names to sort keys
+ */
+ public $mCategories;
+
+ /**
+ * @var array $mIndicators Page status indicators, usually displayed in top-right corner.
+ */
+ public $mIndicators = array();
+
+ /**
+ * @var string $mTitleText Title text of the chosen language variant
+ */
+ public $mTitleText;
+
+ /**
+ * @var array $mLinks 2-D map of NS/DBK to ID for the links in the document.
+ * ID=zero for broken.
+ */
+ public $mLinks = array();
+
+ /**
+ * @var array $mTemplates 2-D map of NS/DBK to ID for the template references.
+ * ID=zero for broken.
+ */
+ public $mTemplates = array();
+
+ /**
+ * @var array $mTemplateIds 2-D map of NS/DBK to rev ID for the template references.
+ * ID=zero for broken.
+ */
+ public $mTemplateIds = array();
+
+ /**
+ * @var array $mImages DB keys of the images used, in the array key only
+ */
+ public $mImages = array();
+
+ /**
+ * @var array $mFileSearchOptions DB keys of the images used mapped to sha1 and MW timestamp.
+ */
+ public $mFileSearchOptions = array();
+
+ /**
+ * @var array $mExternalLinks External link URLs, in the key only.
+ */
+ public $mExternalLinks = array();
+
+ /**
+ * @var array $mInterwikiLinks 2-D map of prefix/DBK (in keys only)
+ * for the inline interwiki links in the document.
+ */
+ public $mInterwikiLinks = array();
+
+ /**
+ * @var bool $mNewSection Show a new section link?
+ */
+ public $mNewSection = false;
+
+ /**
+ * @var bool $mHideNewSection Hide the new section link?
+ */
+ public $mHideNewSection = false;
+
+ /**
+ * @var bool $mNoGallery No gallery on category page? (__NOGALLERY__).
+ */
+ public $mNoGallery = false;
+
+ /**
+ * @var array $mHeadItems Items to put in the <head> section
+ */
+ public $mHeadItems = array();
+
+ /**
+ * @var array $mModules Modules to be loaded by the resource loader
+ */
+ public $mModules = array();
+
+ /**
+ * @var array $mModuleScripts Modules of which only the JS will be loaded by
+ * the resource loader.
+ */
+ public $mModuleScripts = array();
+
+ /**
+ * @var array $mModuleStyles Modules of which only the CSSS will be loaded by
+ * the resource loader.
+ */
+ public $mModuleStyles = array();
+
+ /**
+ * @var array $mJsConfigVars JavaScript config variable for mw.config combined with this page.
+ */
+ public $mJsConfigVars = array();
+
+ /**
+ * @var array $mOutputHooks Hook tags as per $wgParserOutputHooks.
+ */
+ public $mOutputHooks = array();
+
+ /**
+ * @var array $mWarnings Warning text to be returned to the user.
+ * Wikitext formatted, in the key only.
+ */
+ public $mWarnings = array();
+
+ /**
+ * @var array $mSections Table of contents
+ */
+ public $mSections = array();
+
+ /**
+ * @var bool $mEditSectionTokens prefix/suffix markers if edit sections were output as tokens.
+ */
+ public $mEditSectionTokens = false;
+
+ /**
+ * @var array $mProperties Name/value pairs to be cached in the DB.
+ */
+ public $mProperties = array();
+
+ /**
+ * @var string $mTOCHTML HTML of the TOC.
+ */
+ public $mTOCHTML = '';
+
+ /**
+ * @var string $mTimestamp Timestamp of the revision.
+ */
+ public $mTimestamp;
+
+ /**
+ * @var bool $mTOCEnabled Whether TOC should be shown, can't override __NOTOC__.
+ */
+ public $mTOCEnabled = true;
+
+ /**
+ * @var bool $mEnableOOUI Whether OOUI should be enabled.
+ */
+ public $mEnableOOUI = false;
+
+ /**
+ * @var string $mIndexPolicy 'index' or 'noindex'? Any other value will result in no change.
+ */
+ private $mIndexPolicy = '';
+
+ /**
+ * @var array $mAccessedOptions List of ParserOptions (stored in the keys).
+ */
+ private $mAccessedOptions = array();
+
+ /**
+ * @var array $mExtensionData extra data used by extensions.
+ */
+ private $mExtensionData = array();
+
+ /**
+ * @var array $mLimitReportData Parser limit report data.
+ */
+ private $mLimitReportData = array();
+
+ /**
+ * @var array $mParseStartTime Timestamps for getTimeSinceStart().
+ */
+ private $mParseStartTime = array();
+
+ /**
+ * @var bool $mPreventClickjacking Whether to emit X-Frame-Options: DENY.
+ */
+ private $mPreventClickjacking = false;
+
+ /**
+ * @var array $mFlags Generic flags.
+ */
+ private $mFlags = array();
const EDITSECTION_REGEX =
'#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
*/
public function addSecondaryDataUpdate( DataUpdate $update ) {
wfDeprecated( __METHOD__, '1.25' );
- throw new MWException( 'ParserOutput::addSecondaryDataUpdate() is no longer supported. Override Content::getSecondaryDataUpdates() or use the SecondaryDataUpdates hook instead.' );
+ throw new MWException(
+ 'ParserOutput::addSecondaryDataUpdate() is no longer supported. ' .
+ 'Override Content::getSecondaryDataUpdates() ' .
+ 'or use the SecondaryDataUpdates hook instead.'
+ );
}
/**
* @return string|bool PNG image data, or false on failure
*/
protected function rasterize( $svg ) {
- // This code should be factored out to a separate method on SvgHandler, or perhaps a separate
- // class, with a separate set of configuration settings.
- //
- // This is a distinct use case from regular SVG rasterization:
- // * We can skip many sanity and security checks (as the images come from a trusted source,
- // rather than from the user).
- // * We need to provide extra options to some converters to achieve acceptable quality for very
- // small images, which might cause performance issues in the general case.
- // * We want to directly pass image data to the converter, rather than a file path.
- //
- // See https://phabricator.wikimedia.org/T76473#801446 for examples of what happens with the
- // default settings.
- //
- // For now, we special-case rsvg (used in WMF production) and do a messy workaround for other
- // converters.
+ /**
+ * This code should be factored out to a separate method on SvgHandler, or perhaps a separate
+ * class, with a separate set of configuration settings.
+ *
+ * This is a distinct use case from regular SVG rasterization:
+ * * We can skip many sanity and security checks (as the images come from a trusted source,
+ * rather than from the user).
+ * * We need to provide extra options to some converters to achieve acceptable quality for very
+ * small images, which might cause performance issues in the general case.
+ * * We want to directly pass image data to the converter, rather than a file path.
+ *
+ * See https://phabricator.wikimedia.org/T76473#801446 for examples of what happens with the
+ * default settings.
+ *
+ * For now, we special-case rsvg (used in WMF production) and do a messy workaround for other
+ * converters.
+ */
global $wgSVGConverter, $wgSVGConverterPath;
// section link
if ( $showNewSection ) {
// Adds new section link
- //$content_navigation['actions']['addsection']
+ // $content_navigation['actions']['addsection']
$content_navigation['views']['addsection'] = array(
'class' => ( $isEditing && $section == 'new' ) ? 'selected' : false,
'text' => wfMessageFallback( "$skname-action-addsection", 'addsection' )
}
// Set up some constants...
- $allVowels = array( "е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы",
- "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y" );
- $frontVowels = array( "е", "и", "э", "ө", "ү", "e", "i", "ö", "ü" );
- $backVowels = array( "а", "ё", "о", "у", "ы", "ю", "я", "a", "o", "u", "y" );
- $unroundFrontVowels = array( "е", "и", "э", "e", "i" );
- $roundFrontVowels = array( "ө", "ү", "ö", "ü" );
- $unroundBackVowels = array( "а", "ы", "я", "a", "y" );
- $roundBackVowels = array( "ё", "о", "у", "ю", "o", "u" );
- // $voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" );
- $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x" );
- $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л",
- "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" );
- $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j" );
-
- // $allSonants = array("л", "м", "н", "ң", "р", "й");
- // $allNasals = array("м", "н", "ң");
+ $allVowels = array( "е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я" );
+ $frontVowels = array( "е", "и", "э", "ө", "ү" );
+ $backVowels = array( "а", "ё", "о", "у", "ы", "ю", "я" );
+ $unroundFrontVowels = array( "е", "и", "э" );
+ $roundFrontVowels = array( "ө", "ү" );
+ $unroundBackVowels = array( "а", "ы", "я" );
+ $roundBackVowels = array( "ё", "о", "у", "ю" );
+ $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х" );
+ $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "ң" );
+ $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й" );
// Put the word in a form we can play with since we're using UTF-8
preg_match_all( '/./us', $word, $ar );
// Here's the last letter in the word
$wordEnding = $ar[0][count( $ar[0] ) - 1];
+
// Here's an array with the order of the letters in the word reversed so
// we can find a match quicker. *shrug*
$wordReversed = array_reverse( $ar[0] );
continue;
}
}
+
if ( $wordLastVowel !== null ) {
break;
} else {
$word = implode( "", $ar[0] ) . "тың";
} else {
}
- } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
+ } elseif ( $wordEnding === "л" ) {
if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
$word = implode( "", $ar[0] ) . "дүң";
} elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
$word = implode( "", $ar[0] ) . "ты";
} else {
}
- } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
+ } elseif ( $wordEnding === "л" ) {
if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
$word = implode( "", $ar[0] ) . "дү";
} elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
default:
break;
}
+
return $word;
}
}
#mw-editbutton-hr {
.background-image("images/@{button-hr}");
}
+
+// Awful workaround for T113868, while it awaits a better fix.
+#mw-t113868 {
+ background-image: url(images/ar/button_bold.png), url(images/ar/button_headline.png), url(images/ar/button_italic.png), url(images/ar/button_link.png), url(images/ar/button_nowiki.png), url(images/be-tarask/button_bold.png), url(images/be-tarask/button_italic.png), url(images/be-tarask/button_link.png), url(images/de/button_bold.png), url(images/de/button_italic.png), url(images/en/button_bold.png), url(images/en/button_extlink.png), url(images/en/button_headline.png), url(images/en/button_hr.png), url(images/en/button_image.png), url(images/en/button_italic.png), url(images/en/button_link.png), url(images/en/button_media.png), url(images/en/button_nowiki.png), url(images/en/button_sig.png), url(images/fa/button_bold.png), url(images/fa/button_headline.png), url(images/fa/button_italic.png), url(images/fa/button_link.png), url(images/fa/button_nowiki.png), url(images/ksh/button_italic.png), url(images/ru/button_bold.png), url(images/ru/button_italic.png), url(images/ru/button_link.png);
+}
$this->sectionData['config'] = '';
}
- $isDisabled = preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] ) && !$this->parserTest->runDisabled;
- $isParsoidOnly = preg_match( '/\\bparsoid\\b/i', $this->sectionData['options'] ) && $result == 'html' && !$this->parserTest->runParsoid;
+ $isDisabled = preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] ) &&
+ !$this->parserTest->runDisabled;
+ $isParsoidOnly = preg_match( '/\\bparsoid\\b/i', $this->sectionData['options'] ) &&
+ $result == 'html' &&
+ !$this->parserTest->runParsoid;
$isFiltered = !preg_match( "/" . $this->parserTest->regex . "/i", $this->sectionData['test'] );
if ( $input == false || $result == false || $isDisabled || $isParsoidOnly || $isFiltered ) {
# disabled test