Merge "Fix PHPCS warnings in /includes/mail/"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 28 Sep 2015 12:44:04 +0000 (12:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 28 Sep 2015 12:44:04 +0000 (12:44 +0000)
20 files changed:
includes/htmlform/HTMLCheckField.php
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLFormField.php
includes/htmlform/HTMLTitleTextField.php
includes/htmlform/OOUIHTMLForm.php
includes/htmlform/VFormHTMLForm.php
includes/installer/PostgresInstaller.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
includes/installer/WebInstaller.php
includes/media/Bitmap.php
includes/media/XCF.php
includes/media/XMP.php
includes/page/WikiPage.php
includes/parser/ParserOutput.php
includes/resourceloader/ResourceLoaderImage.php
includes/skins/SkinTemplate.php
languages/classes/LanguageTyv.php
resources/src/mediawiki.toolbar/toolbar.less
tests/testHelpers.inc

index 9666c4e..b226854 100644 (file)
@@ -56,7 +56,10 @@ class HTMLCheckField extends HTMLFormField {
                $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 );
index 2779d5a..e51620f 100644 (file)
@@ -959,7 +959,11 @@ class HTMLForm extends ContextSource {
                        $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
+               );
        }
 
        /**
index 484b29a..20d7250 100644 (file)
@@ -925,7 +925,8 @@ abstract class HTMLFormField {
         * 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 ) {
index a225c67..ade4cf7 100644 (file)
@@ -55,7 +55,9 @@ class HTMLTitleTextField extends HTMLTextField {
                }
 
                $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();
                }
 
index f8aa0ac..60f02a1 100644 (file)
@@ -39,7 +39,9 @@ class OOUIHTMLForm extends HTMLForm {
         */
        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;
index 3788379..124a3d5 100644 (file)
@@ -42,7 +42,9 @@ class VFormHTMLForm extends HTMLForm {
                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;
index cb40f88..c10e81a 100644 (file)
@@ -83,7 +83,12 @@ class PostgresInstaller extends DatabaseInstaller {
 
        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();
index 0c984ce..7414d92 100644 (file)
@@ -250,7 +250,8 @@ class PostgresUpdater extends DatabaseUpdater {
                        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)' ),
@@ -955,6 +956,7 @@ END;
                        $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' );
        }
 }
index 2693be0..0de1fd7 100644 (file)
@@ -132,7 +132,8 @@ class SqliteUpdater extends DatabaseUpdater {
                        // 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' ),
index 74904f1..c2243b9 100644 (file)
@@ -960,7 +960,8 @@ class WebInstaller extends Installer {
         *      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
index 0b5b8b6..692e5a6 100644 (file)
@@ -299,7 +299,6 @@ class BitmapHandler extends TransformationalImageHandler {
         */
        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.
 
index 16e11dc..41e1d54 100644 (file)
@@ -106,21 +106,23 @@ class XCFHandler extends BitmapHandler {
                $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
index 0631183..fb840c2 100644 (file)
@@ -447,9 +447,8 @@ class XMPReader implements LoggerAwareInterface {
                // 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 ) {
@@ -1213,8 +1212,7 @@ class XMPReader implements LoggerAwareInterface {
                        // 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' );
                }
index 424d636..2fde832 100644 (file)
@@ -950,7 +950,6 @@ class WikiPage implements Page, IDBAccessObject {
                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' );
@@ -964,10 +963,8 @@ class WikiPage implements Page, IDBAccessObject {
 
                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 {
@@ -1811,8 +1808,7 @@ class WikiPage implements Page, IDBAccessObject {
                                }
                                $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 );
 
@@ -2817,16 +2813,18 @@ class WikiPage implements Page, IDBAccessObject {
                        $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',
index 2eb1dc9..3745238 100644 (file)
  * @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>))#';
@@ -715,7 +866,11 @@ class ParserOutput extends CacheTime {
         */
        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.'
+               );
        }
 
        /**
index 2338c90..9d5fe38 100644 (file)
@@ -315,21 +315,23 @@ class ResourceLoaderImage {
         * @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;
 
index baf9d95..ae69934 100644 (file)
@@ -928,7 +928,7 @@ class SkinTemplate extends Skin {
                                        // 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' )
index e0eb103..a2a8831 100644 (file)
@@ -44,28 +44,23 @@ class LanguageTyv extends Language {
                }
 
                // 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] );
@@ -81,6 +76,7 @@ class LanguageTyv extends Language {
                                        continue;
                                }
                        }
+
                        if ( $wordLastVowel !== null ) {
                                break;
                        } else {
@@ -102,7 +98,7 @@ class LanguageTyv extends Language {
                                                $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 ) ) {
@@ -155,7 +151,7 @@ class LanguageTyv extends Language {
                                                $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 ) ) {
@@ -249,6 +245,7 @@ class LanguageTyv extends Language {
                        default:
                                break;
                }
+
                return $word;
        }
 }
index d65b284..f86a41d 100644 (file)
@@ -40,3 +40,8 @@
 #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);
+}
index 16f458b..d73496f 100644 (file)
@@ -458,8 +458,11 @@ class TestFileIterator implements Iterator {
                        $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