Merge "Improve GlobalVarConfigTest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 26 Aug 2014 13:54:14 +0000 (13:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 26 Aug 2014 13:54:14 +0000 (13:54 +0000)
75 files changed:
RELEASE-NOTES-1.24
docs/hooks.txt
includes/Block.php
includes/EditPage.php
includes/GlobalFunctions.php
includes/Html.php
includes/Import.php
includes/Linker.php
includes/MagicWord.php
includes/MessageBlobStore.php
includes/Sanitizer.php
includes/Setup.php
includes/User.php
includes/WatchedItem.php
includes/api/ApiFormatBase.php
includes/api/ApiParse.php
includes/cache/LocalisationCache.php
includes/cache/MessageCache.php
includes/changes/ChangesFeed.php
includes/context/RequestContext.php
includes/db/Database.php
includes/db/DatabaseMysqlBase.php
includes/db/DatabaseMysqli.php
includes/db/DatabasePostgres.php
includes/debug/MWDebug.php
includes/deferred/SearchUpdate.php
includes/filerepo/RepoGroup.php
includes/filerepo/file/ArchivedFile.php
includes/filerepo/file/File.php
includes/gallery/ImageGalleryBase.php
includes/gallery/PackedImageGallery.php
includes/htmlform/HTMLCheckField.php
includes/htmlform/HTMLCheckMatrix.php
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLFormField.php
includes/installer/DatabaseInstaller.php
includes/installer/DatabaseUpdater.php
includes/installer/Installer.php
includes/installer/MssqlUpdater.php
includes/installer/MysqlUpdater.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json
includes/jobqueue/JobRunner.php
includes/logging/LogPage.php
includes/media/Exif.php
includes/page/Article.php
includes/parser/ParserOutput.php
includes/resourceloader/ResourceLoader.php
includes/search/SearchHighlighter.php
includes/specials/SpecialListDuplicatedFiles.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPageLanguage.php
includes/specials/SpecialResetTokens.php
includes/upload/UploadFromChunks.php
includes/utils/Cdb.php
includes/utils/MWCryptRand.php
languages/i18n/qqq.json
maintenance/archives/patch-fa_major_mime-chemical.sql [new file with mode: 0644]
maintenance/archives/patch-img_major_mime-chemical.sql [new file with mode: 0644]
maintenance/archives/patch-oi_major_mime-chemical.sql [new file with mode: 0644]
maintenance/checkSyntax.php
maintenance/findHooks.php
maintenance/getConfiguration.php
maintenance/mssql/archives/patch-fa_major_mime-chemical.sql [new file with mode: 0644]
maintenance/mssql/archives/patch-img_major_mime-chemical.sql [new file with mode: 0644]
maintenance/mssql/archives/patch-oi_major_mime-chemical.sql [new file with mode: 0644]
maintenance/mssql/tables.sql
maintenance/mssql/update-keys.sql [new file with mode: 0644]
maintenance/sql.php
maintenance/tables.sql
maintenance/update-keys.sql [new file with mode: 0644]
resources/src/startup.js
tests/qunit/suites/resources/startup.test.js

index 32ce12b..c2a1e2b 100644 (file)
@@ -63,6 +63,8 @@ production.
 * The default thumb size ($wgDefaultUserOptions['thumbsize']) is now 300px, up from
   180px. If you have altered the number of entries in $wgThumbLimits for your wiki, you
   may need to adjust your default user settings to compensate for the index change.
+* $wgDeferredUpdateList is now deprecated, you should use DeferredUpdates::addUpdate()
+  instead.
 
 === New features in 1.24 ===
 * Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
@@ -304,7 +306,7 @@ changes to languages because of Bugzilla reports.
   set of hooks has been removed and replaced by a single new hook
   SpecialPageBeforeFormDisplay.
 * (bug 65781) Removed block warning on included {{Special:Contributions}}
-* Removed Skin::makeGlobalVariablesScript. (deprecated since 1.19)
+* Removed Skin::makeGlobalVariablesScript(). (deprecated since 1.19)
 * Removed MWNamespace::isMain(). (deprecated since 1.19)
 * Removed Preferences::loadOldSearchNs(). (deprecated since 1.19)
 * Removed OutputPage::getStatusMessage(). (deprecated since 1.18)
@@ -342,16 +344,19 @@ changes to languages because of Bugzilla reports.
   setPreloadedText() from EditPage.php. (deprecated since 1.21)
 * Removed global functions wfArrayLookup(), wfArrayMerge(), wfDebugDieBacktrace()
   and wfTime(). (deprecated since 1.22)
-* Microsoft Internet Explorer 6 is now a "grade C" browser, meaning that
-  JavaScript is no longer executed in this browser. The IEFixes script, which
-  existed purely to provide support for MSIE versions below 7 and which was
-  conditionally loaded for those browsers, was also removed.
+* Browser support for Internet Explorer 6 lowered from Grade A to Grade C,
+  meaning that JavaScript is no longer executed in this browser.
+* Browser support for Opera 11 lowered from Grade A to Grade C.
+* Removed IEFixes module which existed purely to provide support for MSIE versions
+  below 7 (conditionally loaded only for those browsers).
 * Action::checkCanExecute() no longer has a return value.
 * Removed cleanupForIRC(), loadFromCurRow(), newFromCurRow(), notifyRC2UDP()
   and sendToUDP() from RecentChange.php. (deprecated since 1.22)
 * Removed EnhancedChangesList::arrow(), sideArrow(), downArrow(), spacerArrow().
 * Removed Xml::namespaceSelector(). (deprecated since 1.19)
-* Removed WikiPage::estimateRevisionCount. (deprecated since 1.19)
+* Removed WikiPage::estimateRevisionCount(). (deprecated since 1.19)
+* MYSQL: Enum item added to "major MIME type" columns.
+  Running update.php on MySQL < v5.1 may result in heavy processing.
 
 ==== Renamed classes ====
 * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
index fc29858..d704eb5 100644 (file)
@@ -1773,13 +1773,6 @@ $db: The database object to be queried.
 &$opts: Options for the query.
 &$join_conds: Join conditions for the query.
 
-'MonoBookTemplateToolboxEnd': DEPRECATED. Called by Monobook skin after toolbox
-links have been rendered (useful for adding more). Note: this is only run for
-the Monobook skin. To add items to the toolbox you should use the
-SkinTemplateToolboxEnd hook instead, which works for all "SkinTemplate"-type
-skins.
-$tools: array of tools
-
 'BaseTemplateToolbox': Called by BaseTemplate when building the $toolbox array
 and returning it for the skin to output. You can add items to the toolbox while
 still letting the skin make final decisions on skin-specific markup conventions
index 88534c0..6a29a05 100644 (file)
@@ -596,7 +596,6 @@ class Block {
         *
         * @param Block $block
         * @param array &$blockIds
-        * @return array Block IDs of retroactive autoblocks made
         */
        protected static function defaultRetroactiveAutoblock( Block $block, array &$blockIds ) {
                global $wgPutIPinRC;
index 70eb909..b83569d 100644 (file)
@@ -2758,7 +2758,6 @@ class EditPage {
         *   up top, or false if this is the comment summary
         *   down below the textarea
         * @param string $summary The text of the summary to display
-        * @return string
         */
        protected function showSummaryInput( $isSubjectPreview, $summary = "" ) {
                global $wgOut, $wgContLang;
@@ -3100,6 +3099,7 @@ HTML
         * Get the copyright warning
         *
         * Renamed to getCopyrightWarning(), old name kept around for backwards compatibility
+        * @return string
         */
        protected function getCopywarn() {
                return self::getCopyrightWarning( $this->mTitle );
index 805ba9e..ddea620 100644 (file)
@@ -38,6 +38,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 if ( !function_exists( 'mb_substr' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_substr
         * @return string
         */
        function mb_substr( $str, $start, $count = 'end' ) {
@@ -46,6 +47,7 @@ if ( !function_exists( 'mb_substr' ) ) {
 
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_substr_split_unicode
         * @return int
         */
        function mb_substr_split_unicode( $str, $splitPos ) {
@@ -56,6 +58,7 @@ if ( !function_exists( 'mb_substr' ) ) {
 if ( !function_exists( 'mb_strlen' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_strlen
         * @return int
         */
        function mb_strlen( $str, $enc = '' ) {
@@ -66,6 +69,7 @@ if ( !function_exists( 'mb_strlen' ) ) {
 if ( !function_exists( 'mb_strpos' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_strpos
         * @return int
         */
        function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
@@ -76,6 +80,7 @@ if ( !function_exists( 'mb_strpos' ) ) {
 if ( !function_exists( 'mb_strrpos' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_strrpos
         * @return int
         */
        function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
index 9e7f5c4..48dbdba 100644 (file)
@@ -673,6 +673,7 @@ class Html {
         * @param string $name Name attribute
         * @param bool $checked Whether the checkbox is checked or not
         * @param array $attribs Array of additional attributes
+        * @return string
         */
        public static function check( $name, $checked = false, array $attribs = array() ) {
                if ( isset( $attribs['value'] ) ) {
@@ -695,6 +696,7 @@ class Html {
         * @param string $name Name attribute
         * @param bool $checked Whether the checkbox is checked or not
         * @param array $attribs Array of additional attributes
+        * @return string
         */
        public static function radio( $name, $checked = false, array $attribs = array() ) {
                if ( isset( $attribs['value'] ) ) {
@@ -717,6 +719,7 @@ class Html {
         * @param string $label Contents of the label
         * @param string $id ID of the element being labeled
         * @param array $attribs Additional attributes
+        * @return string
         */
        public static function label( $label, $id, array $attribs = array() ) {
                $attribs += array(
index 3880e25..b3ca041 100644 (file)
@@ -1494,9 +1494,6 @@ class WikiRevision {
                return true;
        }
 
-       /**
-        * @return mixed
-        */
        function importLogItem() {
                $dbw = wfGetDB( DB_MASTER );
                # @todo FIXME: This will not record autoblocks
index 05caeaa..05bace5 100644 (file)
@@ -259,6 +259,7 @@ class Linker {
 
        /**
         * Identical to link(), except $options defaults to 'known'.
+        * @see Linker::link
         * @return string
         */
        public static function linkKnown(
index 7decbee..4d17298 100644 (file)
@@ -754,6 +754,7 @@ class MagicWordArray {
 
        /**
         * Get a 2-d hashtable for this array
+        * @return array
         */
        function getHash() {
                if ( is_null( $this->hash ) ) {
@@ -775,6 +776,7 @@ class MagicWordArray {
 
        /**
         * Get the base regex
+        * @return array
         */
        function getBaseRegex() {
                if ( is_null( $this->baseRegex ) ) {
@@ -799,6 +801,7 @@ class MagicWordArray {
 
        /**
         * Get an unanchored regex that does not match parameters
+        * @return array
         */
        function getRegex() {
                if ( is_null( $this->regex ) ) {
index 5725898..e3b4dbe 100644 (file)
  * constituent messages or the resource itself is changed.
  */
 class MessageBlobStore {
+       /**
+        * Get the singleton instance
+        *
+        * @since 1.24
+        * @return MessageBlobStore
+        */
+       public static function getInstance() {
+               static $instance = null;
+               if ( $instance === null ) {
+                       $instance = new self;
+               }
+
+               return $instance;
+       }
+
        /**
         * Get the message blobs for a set of modules
         *
@@ -40,19 +55,19 @@ class MessageBlobStore {
         * @param string $lang Language code
         * @return array An array mapping module names to message blobs
         */
-       public static function get( ResourceLoader $resourceLoader, $modules, $lang ) {
+       public function get( ResourceLoader $resourceLoader, $modules, $lang ) {
                wfProfileIn( __METHOD__ );
                if ( !count( $modules ) ) {
                        wfProfileOut( __METHOD__ );
                        return array();
                }
                // Try getting from the DB first
-               $blobs = self::getFromDB( $resourceLoader, array_keys( $modules ), $lang );
+               $blobs = $this->getFromDB( $resourceLoader, array_keys( $modules ), $lang );
 
                // Generate blobs for any missing modules and store them in the DB
                $missing = array_diff( array_keys( $modules ), array_keys( $blobs ) );
                foreach ( $missing as $name ) {
-                       $blob = self::insertMessageBlob( $name, $modules[$name], $lang );
+                       $blob = $this->insertMessageBlob( $name, $modules[$name], $lang );
                        if ( $blob ) {
                                $blobs[$name] = $blob;
                        }
@@ -72,8 +87,8 @@ class MessageBlobStore {
         * @param string $lang Language code
         * @return mixed Message blob or false if the module has no messages
         */
-       public static function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
-               $blob = self::generateMessageBlob( $module, $lang );
+       public function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
+               $blob = $this->generateMessageBlob( $module, $lang );
 
                if ( !$blob ) {
                        return false;
@@ -130,7 +145,7 @@ class MessageBlobStore {
         * @return string Regenerated message blob, or null if there was no blob for
         *   the given module/language pair.
         */
-       public static function updateModule( $name, ResourceLoaderModule $module, $lang ) {
+       public function updateModule( $name, ResourceLoaderModule $module, $lang ) {
                $dbw = wfGetDB( DB_MASTER );
                $row = $dbw->selectRow( 'msg_resource', 'mr_blob',
                        array( 'mr_resource' => $name, 'mr_lang' => $lang ),
@@ -142,7 +157,7 @@ class MessageBlobStore {
 
                // Save the old and new blobs for later
                $oldBlob = $row->mr_blob;
-               $newBlob = self::generateMessageBlob( $module, $lang );
+               $newBlob = $this->generateMessageBlob( $module, $lang );
 
                try {
                        $newRow = array(
@@ -197,7 +212,7 @@ class MessageBlobStore {
         *
         * @param string $key Message key
         */
-       public static function updateMessage( $key ) {
+       public function updateMessage( $key ) {
                try {
                        $dbw = wfGetDB( DB_MASTER );
 
@@ -206,7 +221,7 @@ class MessageBlobStore {
                        // in one iteration.
                        $updates = null;
                        do {
-                               $updates = self::getUpdatesForMessage( $key, $updates );
+                               $updates = $this->getUpdatesForMessage( $key, $updates );
 
                                foreach ( $updates as $k => $update ) {
                                        // Update the row on the condition that it
@@ -240,7 +255,7 @@ class MessageBlobStore {
                }
        }
 
-       public static function clear() {
+       public function clear() {
                // TODO: Give this some more thought
                try {
                        // Not using TRUNCATE, because that needs extra permissions,
@@ -260,7 +275,7 @@ class MessageBlobStore {
         * @param array $prevUpdates Updates queue to refresh or null to build a fresh update queue
         * @return array Updates queue
         */
-       private static function getUpdatesForMessage( $key, $prevUpdates = null ) {
+       private function getUpdatesForMessage( $key, $prevUpdates = null ) {
                $dbw = wfGetDB( DB_MASTER );
 
                if ( is_null( $prevUpdates ) ) {
@@ -297,7 +312,7 @@ class MessageBlobStore {
                                'resource' => $row->mr_resource,
                                'lang' => $row->mr_lang,
                                'timestamp' => $row->mr_timestamp,
-                               'newBlob' => self::reencodeBlob( $row->mr_blob, $key, $row->mr_lang )
+                               'newBlob' => $this->reencodeBlob( $row->mr_blob, $key, $row->mr_lang )
                        );
                }
 
@@ -312,7 +327,7 @@ class MessageBlobStore {
         * @param string $lang Language code
         * @return string Message blob with $key replaced with its new value
         */
-       private static function reencodeBlob( $blob, $key, $lang ) {
+       private function reencodeBlob( $blob, $key, $lang ) {
                $decoded = FormatJson::decode( $blob, true );
                $decoded[$key] = wfMessage( $key )->inLanguage( $lang )->plain();
 
@@ -329,9 +344,8 @@ class MessageBlobStore {
         * @throws MWException
         * @return array Array mapping module names to blobs
         */
-       private static function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) {
-               global $wgCacheEpoch;
-
+       private function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) {
+               $config = $resourceLoader->getConfig();
                $retval = array();
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'msg_resource',
@@ -348,13 +362,13 @@ class MessageBlobStore {
                        }
 
                        // Update the module's blobs if the set of messages changed or if the blob is
-                       // older than $wgCacheEpoch
+                       // older than the CacheEpoch setting
                        $keys = array_keys( FormatJson::decode( $row->mr_blob, true ) );
                        $values = array_values( array_unique( $module->getMessages() ) );
                        if ( $keys !== $values
-                               || wfTimestamp( TS_MW, $row->mr_timestamp ) <= $wgCacheEpoch
+                               || wfTimestamp( TS_MW, $row->mr_timestamp ) <= $config->get( 'CacheEpoch' )
                        ) {
-                               $retval[$row->mr_resource] = self::updateModule( $row->mr_resource, $module, $lang );
+                               $retval[$row->mr_resource] = $this->updateModule( $row->mr_resource, $module, $lang );
                        } else {
                                $retval[$row->mr_resource] = $row->mr_blob;
                        }
@@ -370,7 +384,7 @@ class MessageBlobStore {
         * @param string $lang Language code
         * @return string JSON object
         */
-       private static function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
+       private function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
                $messages = array();
 
                foreach ( $module->getMessages() as $key ) {
index b173ae9..2cdbe15 100644 (file)
@@ -328,6 +328,7 @@ class Sanitizer {
         * Regular expression to match HTML/XML attribute pairs within a tag.
         * Allows some... latitude.
         * Used in Sanitizer::fixTagAttributes and Sanitizer::decodeTagAttributes
+        * @return string
         */
        static function getAttribsRegex() {
                if ( self::$attribsRegex === null ) {
index 0c5cf92..acceb59 100644 (file)
@@ -595,6 +595,10 @@ if ( !is_object( $wgAuth ) ) {
  */
 $wgTitle = null;
 
+/**
+ * @deprecated 1.24 Use DeferredUpdates::addUpdate instead
+ * @var array
+ */
 $wgDeferredUpdateList = array();
 
 // Disable all other email settings automatically if $wgEnableEmail
index 7e846ad..665edb9 100644 (file)
@@ -3086,10 +3086,8 @@ class User implements IDBAccessObject {
        /**
         * Check if user is allowed to access a feature / make an action
         *
-        * @internal param \String $varargs permissions to test
+        * @param string $permissions,... Permissions to test
         * @return bool True if user is allowed to perform *any* of the given actions
-        *
-        * @return bool
         */
        public function isAllowedAny( /*...*/ ) {
                $permissions = func_get_args();
@@ -3103,7 +3101,7 @@ class User implements IDBAccessObject {
 
        /**
         *
-        * @internal param $varargs string
+        * @param string $permissions,... Permissions to test
         * @return bool True if the user is allowed to perform *all* of the given actions
         */
        public function isAllowedAll( /*...*/ ) {
index 93d6c0b..d9a1e80 100644 (file)
@@ -164,6 +164,7 @@ class WatchedItem {
        /**
         * Check permissions
         * @param string $what 'viewmywatchlist' or 'editmywatchlist'
+        * @return bool
         */
        private function isAllowed( $what ) {
                return !$this->mCheckRights || $this->mUser->isAllowed( $what );
index 2e3fc11..0e3b612 100644 (file)
@@ -247,6 +247,7 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
 
        /**
         * Get the contents of the buffer.
+        * @return string
         */
        public function getBuffer() {
                return $this->mBuffer;
index d09470b..06fdf85 100644 (file)
@@ -473,6 +473,7 @@ class ApiParse extends ApiBase {
        /**
         * @param Content $content
         * @param string $what Identifies the content in error messages, e.g. page title.
+        * @return Content|bool
         */
        private function getSectionContent( Content $content, $what ) {
                // Not cached (save or load)
index e2e304a..bdfe510 100644 (file)
@@ -686,6 +686,7 @@ class LocalisationCache {
         *
         * @param string $code
         * @param array $deps
+        * @return array
         */
        protected function readSourceFilesAndRegisterDeps( $code, &$deps ) {
                global $IP;
@@ -983,7 +984,7 @@ class LocalisationCache {
                # HACK: If using a null (i.e. disabled) storage backend, we
                # can't write to the MessageBlobStore either
                if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) {
-                       MessageBlobStore::clear();
+                       MessageBlobStore::getInstance()->clear();
                }
 
                wfProfileOut( __METHOD__ );
index e34961c..1ef7cc5 100644 (file)
@@ -573,7 +573,7 @@ class MessageCache {
 
                // Update the message in the message blob store
                global $wgContLang;
-               MessageBlobStore::updateMessage( $wgContLang->lcfirst( $msg ) );
+               MessageBlobStore::getInstance()->updateMessage( $wgContLang->lcfirst( $msg ) );
 
                wfRunHooks( 'MessageCacheReplace', array( $title, $text ) );
 
index fb491e5..2d3b919 100644 (file)
@@ -180,6 +180,7 @@ class ChangesFeed {
        /**
         * Generate the feed items given a row from the database.
         * @param object $rows DatabaseBase resource with recentchanges rows
+        * @return array
         */
        public static function buildItems( $rows ) {
                wfProfileIn( __METHOD__ );
index 5178189..091e8da 100644 (file)
@@ -297,7 +297,7 @@ class RequestContext implements IContextSource {
                        $e = new Exception;
                        wfDebugLog( 'recursion-guard', "Recursion detected:\n" . $e->getTraceAsString() );
 
-                       $code = $this->getConfig()->get( 'LanguageCode' ) ? : 'en';
+                       $code = $this->getConfig()->get( 'LanguageCode' ) ?: 'en';
                        $this->lang = Language::factory( $code );
                } elseif ( $this->lang === null ) {
                        $this->recursion = true;
index 65ae444..a46ee1c 100644 (file)
@@ -710,19 +710,42 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
        }
 
        /**
-        * Return a path to the DBMS-specific schema file, otherwise default to tables.sql
+        * Return a path to the DBMS-specific SQL file if it exists,
+        * otherwise default SQL file
         *
+        * @param string $filename
         * @return string
         */
-       public function getSchemaPath() {
+       private function getSqlFilePath( $filename ) {
                global $IP;
-               if ( file_exists( "$IP/maintenance/" . $this->getType() . "/tables.sql" ) ) {
-                       return "$IP/maintenance/" . $this->getType() . "/tables.sql";
+               $dbmsSpecificFilePath = "$IP/maintenance/" . $this->getType() . "/$filename";
+               if ( file_exists( $dbmsSpecificFilePath ) ) {
+                       return $dbmsSpecificFilePath;
                } else {
-                       return "$IP/maintenance/tables.sql";
+                       return "$IP/maintenance/$filename";
                }
        }
 
+       /**
+        * Return a path to the DBMS-specific schema file,
+        * otherwise default to tables.sql
+        *
+        * @return string
+        */
+       public function getSchemaPath() {
+               return $this->getSqlFilePath( 'tables.sql' );
+       }
+
+       /**
+        * Return a path to the DBMS-specific update key file,
+        * otherwise default to update-keys.sql
+        *
+        * @return string
+        */
+       public function getUpdateKeysPath() {
+               return $this->getSqlFilePath( 'update-keys.sql' );
+       }
+
 # ------------------------------------------------------------------------------
 # Other functions
 # ------------------------------------------------------------------------------
@@ -4201,6 +4224,7 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
 
        /**
         * @since 1.19
+        * @return string
         */
        public function __toString() {
                return (string)$this->mConn;
index 5ad7c78..ba0f39f 100644 (file)
@@ -901,7 +901,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
 
        /**
         * @param bool $value
-        * @return null|bool|ResultWrapper
         */
        public function setBigSelects( $value = true ) {
                if ( $value === 'default' ) {
index b8d5d79..2ce6307 100644 (file)
@@ -292,6 +292,7 @@ class DatabaseMysqli extends DatabaseMysqlBase {
         * Give an id for the connection
         *
         * mysql driver used resource id, but mysqli objects cannot be cast to string.
+        * @return string
         */
        public function __toString() {
                if ( $this->mConn instanceof Mysqli ) {
index 45fb3f6..ce14d7a 100644 (file)
@@ -117,6 +117,7 @@ SQL;
 
        /**
         * @since 1.19
+        * @return bool|mixed
         */
        function defaultValue() {
                if ( $this->has_default ) {
@@ -829,6 +830,7 @@ __INDEXATTR__;
         * so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly.
         *
         * MySQL uses "ORDER BY NULL" as an optimization hint, but that syntax is illegal in PostgreSQL.
+        * @see DatabaseBase::selectSQLText
         */
        function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
                $options = array(), $join_conds = array()
index 0cea658..01e0ba0 100644 (file)
@@ -182,7 +182,6 @@ class MWDebug {
         * @param int $callerOffset How far up the callstack is the original
         *    caller. 2 = function that called the function that called
         *    MWDebug::deprecated() (Added in 1.20).
-        * @return mixed
         */
        public static function deprecated( $function, $version = false,
                $component = false, $callerOffset = 2
index 1466605..5d084af 100644 (file)
@@ -116,6 +116,7 @@ class SearchUpdate implements DeferrableUpdate {
         * If you're using a real search engine, you'll probably want to override
         * this behavior and do something nicer with the original wikitext.
         * @param string $text
+        * @return string
         */
        public static function updateText( $text ) {
                global $wgContLang;
index 8c0c781..fab4216 100644 (file)
@@ -406,6 +406,7 @@ class RepoGroup {
        /**
         * Create a repo class based on an info structure
         * @param array $info
+        * @return FileRepo
         */
        protected function newRepo( $info ) {
                $class = $info['class'];
index a71acde..8bf9040 100644 (file)
@@ -407,6 +407,7 @@ class ArchivedFile {
        /**
         * Returns the number of pages of a multipage document, or false for
         * documents which aren't multipage documents
+        * @return bool|int
         */
        function pageCount() {
                if ( !isset( $this->pageCount ) ) {
index f612aa3..4fab33b 100644 (file)
@@ -1331,6 +1331,7 @@ abstract class File {
        /**
         * Get last thumbnailing error.
         * Largely obsolete.
+        * @return string
         */
        function getLastError() {
                return $this->lastError;
index b61a352..b0a593d 100644 (file)
@@ -87,6 +87,7 @@ abstract class ImageGalleryBase extends ContextSource {
         *
         * @param string|bool $mode Mode to use. False to use the default
         * @param IContextSource|null $context
+        * @return ImageGalleryBase
         * @throws MWException
         */
        static function factory( $mode = false, IContextSource $context = null ) {
index 207efa8..52a49dd 100644 (file)
@@ -95,6 +95,7 @@ class PackedImageGallery extends TraditionalImageGallery {
        /**
         * Add javascript which auto-justifies the rows by manipulating the image sizes.
         * Also ensures that the hover version of this degrades gracefully.
+        * @return array
         */
        protected function getModules() {
                return array( 'mediawiki.page.gallery' );
index 4eb7e6e..5f70362 100644 (file)
@@ -5,6 +5,8 @@
  */
 class HTMLCheckField extends HTMLFormField {
        function getInputHTML( $value ) {
+               global $wgUseMediaWikiUIEverywhere;
+
                if ( !empty( $this->mParams['invert'] ) ) {
                        $value = !$value;
                }
@@ -26,7 +28,19 @@ class HTMLCheckField extends HTMLFormField {
                                ),
                                Xml::check( $this->mName, $value, $attr ) . $this->mLabel );
                } else {
-                       return Xml::checkLabel( $this->mLabel, $this->mName, $this->mID, $value, $attr );
+                       $chkLabel = Xml::check( $this->mName, $value, $attr )
+                       . '&#160;'
+                       . Html::rawElement( 'label', array( 'for' => $this->mID ), $this->mLabel );
+
+                       if ( $wgUseMediaWikiUIEverywhere ) {
+                               $chkLabel = Html::rawElement(
+                                       'div',
+                                       array( 'class' => 'mw-ui-checkbox' ),
+                                       $chkLabel
+                               );
+                       }
+
+                       return $chkLabel;
                }
        }
 
index 8255526..6c538fd 100644 (file)
@@ -80,8 +80,6 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable {
         * @return string
         */
        function getInputHTML( $value ) {
-               global $wgUseMediaWikiUIEverywhere;
-
                $html = '';
                $tableContents = '';
                $rows = $this->mParams['rows'];
@@ -129,7 +127,7 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable {
                                        $thisAttribs['disabled'] = 1;
                                }
                                $chkBox = Xml::check( "{$this->mName}[]", $checked, $attribs + $thisAttribs );
-                               if ( $wgUseMediaWikiUIEverywhere ) {
+                               if ( $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
                                        $chkBox = Html::openElement( 'div', array( 'class' => 'mw-ui-checkbox' ) ) .
                                                $chkBox .
                                                Html::element( 'label', array( 'for' => $thisId ) ) .
index 6501890..3a455ab 100644 (file)
@@ -300,9 +300,8 @@ class HTMLForm extends ContextSource {
         * @return string
         */
        public function getDisplayFormat() {
-               global $wgHTMLFormAllowTableFormat;
                $format = $this->displayFormat;
-               if ( !$wgHTMLFormAllowTableFormat && $format === 'table' ) {
+               if ( !$this->getConfig()->get( 'HTMLFormAllowTableFormat' ) && $format === 'table' ) {
                        $format = 'div';
                }
                return $format;
@@ -845,8 +844,6 @@ class HTMLForm extends ContextSource {
         * @return string HTML.
         */
        function getHiddenFields() {
-               global $wgArticlePath;
-
                $html = '';
                if ( $this->getMethod() == 'post' ) {
                        $html .= Html::hidden(
@@ -857,7 +854,8 @@ class HTMLForm extends ContextSource {
                        $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
                }
 
-               if ( strpos( $wgArticlePath, '?' ) !== false && $this->getMethod() == 'get' ) {
+               $articlePath = $this->getConfig()->get( 'ArticlePath' );
+               if ( strpos( $articlePath, '?' ) !== false && $this->getMethod() == 'get' ) {
                        $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
                }
 
@@ -874,8 +872,8 @@ class HTMLForm extends ContextSource {
         * @return string HTML.
         */
        function getButtons() {
-               global $wgUseMediaWikiUIEverywhere;
                $buttons = '';
+               $useMediaWikiUIEverywhere = $this->getConfig()->get( 'UseMediaWikiUIEverywhere' );
 
                if ( $this->mShowSubmit ) {
                        $attribs = array();
@@ -894,7 +892,7 @@ class HTMLForm extends ContextSource {
 
                        $attribs['class'] = array( 'mw-htmlform-submit' );
 
-                       if ( $this->isVForm() || $wgUseMediaWikiUIEverywhere ) {
+                       if ( $this->isVForm() || $useMediaWikiUIEverywhere ) {
                                array_push( $attribs['class'], 'mw-ui-button', 'mw-ui-constructive' );
                        }
 
@@ -937,7 +935,7 @@ class HTMLForm extends ContextSource {
                                $attrs['id'] = $button['id'];
                        }
 
-                       if ( $wgUseMediaWikiUIEverywhere ) {
+                       if ( $useMediaWikiUIEverywhere ) {
                                if ( isset( $attrs['class' ] ) ) {
                                        $attrs['class'] .= ' mw-ui-button';
                                } else {
@@ -1438,20 +1436,19 @@ class HTMLForm extends ContextSource {
         * @return string
         */
        public function getAction() {
-               global $wgScript, $wgArticlePath;
-
                // If an action is alredy provided, return it
                if ( $this->mAction !== false ) {
                        return $this->mAction;
                }
 
-               // Check whether we are in GET mode and $wgArticlePath contains a "?"
+               $articlePath = $this->getConfig()->get( 'ArticlePath' );
+               // Check whether we are in GET mode and the ArticlePath contains a "?"
                // meaning that getLocalURL() would return something like "index.php?title=...".
                // As browser remove the query string before submitting GET forms,
-               // it means that the title would be lost. In such case use $wgScript instead
+               // it means that the title would be lost. In such case use wfScript() instead
                // and put title in an hidden field (see getHiddenFields()).
-               if ( strpos( $wgArticlePath, '?' ) !== false && $this->getMethod() === 'get' ) {
-                       return $wgScript;
+               if ( strpos( $articlePath, '?' ) !== false && $this->getMethod() === 'get' ) {
+                       return wfScript();
                }
 
                return $this->getTitle()->getLocalURL();
index 7e4b15b..70b1535 100644 (file)
@@ -593,6 +593,9 @@ abstract class HTMLFormField {
                $wrapperAttributes = array(
                        'class' => 'htmlform-tip',
                );
+               if ( $this->mHelpClass !== false ) {
+                       $wrapperAttributes['class'] .= " {$this->mHelpClass}";
+               }
                if ( $this->mHideIf ) {
                        $wrapperAttributes['data-hide-if'] = FormatJson::encode( $this->mHideIf );
                        $wrapperAttributes['class'] .= ' mw-htmlform-hide-if';
index 8a01b32..31b93c8 100644 (file)
@@ -163,19 +163,26 @@ abstract class DatabaseInstaller {
        }
 
        /**
-        * Create database tables from scratch.
+        * Apply a SQL source file to the database as part of running an installation step.
         *
+        * @param string $sourceFileMethod
+        * @param string $stepName
+        * @param string $archiveTableMustNotExist
         * @return Status
         */
-       public function createTables() {
+       private function stepApplySourceFile(
+               $sourceFileMethod,
+               $stepName,
+               $archiveTableMustNotExist = false
+       ) {
                $status = $this->getConnection();
                if ( !$status->isOK() ) {
                        return $status;
                }
                $this->db->selectDB( $this->getVar( 'wgDBname' ) );
 
-               if ( $this->db->tableExists( 'archive', __METHOD__ ) ) {
-                       $status->warning( 'config-install-tables-exist' );
+               if ( $archiveTableMustNotExist && $this->db->tableExists( 'archive', __METHOD__ ) ) {
+                       $status->warning( "config-$stepName-tables-exist" );
                        $this->enableLB();
 
                        return $status;
@@ -184,11 +191,13 @@ abstract class DatabaseInstaller {
                $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
                $this->db->begin( __METHOD__ );
 
-               $error = $this->db->sourceFile( $this->db->getSchemaPath() );
+               $error = $this->db->sourceFile(
+                       call_user_func( array( $this->db, $sourceFileMethod ) )
+               );
                if ( $error !== true ) {
                        $this->db->reportQueryError( $error, 0, '', __METHOD__ );
                        $this->db->rollback( __METHOD__ );
-                       $status->fatal( 'config-install-tables-failed', $error );
+                       $status->fatal( "config-$stepName-tables-failed", $error );
                } else {
                        $this->db->commit( __METHOD__ );
                }
@@ -200,6 +209,24 @@ abstract class DatabaseInstaller {
                return $status;
        }
 
+       /**
+        * Create database tables from scratch.
+        *
+        * @return Status
+        */
+       public function createTables() {
+               return $this->stepApplySourceFile( 'getSchemaPath', 'install', true );
+       }
+
+       /**
+        * Insert update keys into table to prevent running unneded updates.
+        *
+        * @return Status
+        */
+       public function insertUpdateKeys() {
+               return $this->stepApplySourceFile( 'getUpdateKeysPath', 'updates', false );
+       }
+
        /**
         * Create the tables for each extension the user enabled
         * @return Status
index 427ded4..193d592 100644 (file)
@@ -907,7 +907,7 @@ abstract class DatabaseUpdater {
                if ( $wgLocalisationCacheConf['manualRecache'] ) {
                        $this->rebuildLocalisationCache();
                }
-               MessageBlobStore::clear();
+               MessageBlobStore::getInstance()->clear();
                $this->output( "done.\n" );
        }
 
@@ -984,6 +984,7 @@ abstract class DatabaseUpdater {
 
        /**
         * Updates the timestamps in the transcache table
+        * @return bool
         */
        protected function doUpdateTranscacheField() {
                if ( $this->updateRowExists( 'convert transcache field' ) ) {
index 57fdab3..aca3119 100644 (file)
@@ -736,6 +736,7 @@ abstract class Installer {
        /**
         * Environment check for register_globals.
         * Prevent installation if enabled
+        * @return bool
         */
        protected function envCheckRegisterGlobals() {
                if ( wfIniGetBool( 'register_globals' ) ) {
@@ -1519,6 +1520,7 @@ abstract class Installer {
                        array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ),
                        array( 'name' => 'stats', 'callback' => array( $this, 'populateSiteStats' ) ),
                        array( 'name' => 'keys', 'callback' => array( $this, 'generateKeys' ) ),
+                       array( 'name' => 'updates', 'callback' => array( $installer, 'insertUpdateKeys' ) ),
                        array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ),
                        array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ),
                );
index 4d86d11..ed11f8b 100644 (file)
@@ -52,6 +52,13 @@ class MssqlUpdater extends DatabaseUpdater {
                        array( 'updateConstraints', 'media_type', 'image', 'img_media_type' ),
                        array( 'updateConstraints', 'media_type', 'uploadstash', 'us_media_type' ),
                        // END: Constraint updates
+
+                       array( 'modifyField', 'image', 'img_major_mime',
+                               'patch-img_major_mime-chemical.sql' ),
+                       array( 'modifyField', 'oldimage', 'oi_major_mime',
+                               'patch-oi_major_mime-chemical.sql' ),
+                       array( 'modifyField', 'filearchive', 'fa_major_mime',
+                               'patch-fa_major_mime-chemical.sql' ),
                );
        }
 
index dcf37b6..990b5b0 100644 (file)
@@ -254,11 +254,18 @@ class MysqlUpdater 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_lang.sql' ),
                        array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ),
                        array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ),
                        array( 'addField', 'imagelinks', 'il_from_namespace', 'patch-il_from_namespace.sql' ),
+                       array( 'modifyField', 'image', 'img_major_mime',
+                               'patch-img_major_mime-chemical.sql' ),
+                       array( 'modifyField', 'oldimage', 'oi_major_mime',
+                               'patch-oi_major_mime-chemical.sql' ),
+                       array( 'modifyField', 'filearchive', 'fa_major_mime',
+                               'patch-fa_major_mime-chemical.sql' ),
                );
        }
 
index bd76ada..ca328cf 100644 (file)
        "config-install-stats": "Initializing statistics",
        "config-install-keys": "Generating secret keys",
        "config-insecure-keys": "<strong>Warning:</strong> {{PLURAL:$2|A secure key|Secure keys}} ($1) generated during installation {{PLURAL:$2|is|are}} not completely safe. Consider changing {{PLURAL:$2|it|them}} manually.",
+       "config-install-updates": "Prevent running unneeded updates",
+       "config-install-updates-failed": "<strong>Error:</strong> Inserting update keys into tables failed with the following error: $1",
        "config-install-sysop": "Creating administrator user account",
        "config-install-subscribe-fail": "Unable to subscribe to mediawiki-announce: $1",
        "config-install-subscribe-notpossible": "cURL is not installed and <code>allow_url_fopen</code> is not available.",
index 8d9aac2..410b1d5 100644 (file)
        "config-install-stats": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
        "config-install-keys": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
        "config-insecure-keys": "Parameters:\n* $1 - A list of names of the secret keys that were generated.\n* $2 - the number of items in the list $1, to be used with PLURAL.",
+       "config-install-updates": "Message indicating that the updatelog table is filled with keys of updates that won't be run when running database updates.",
+       "config-install-updates-failed": "Used as error message. Parameters:\n* $1 - detailed error message",
        "config-install-sysop": "Message indicates that the administrator user account is being created\n\nSee also:\n*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
        "config-install-subscribe-fail": "{{doc-important|\"[[m:mail:mediawiki-announce|mediawiki-announce]]\" is the name of a mailing list and should not be translated.}}\nA message displayed if the MediaWiki installer encounters an error making a request to lists.wikimedia.org which hosts the mailing list.\n* $1 - the HTTP error encountered, reproduced as is (English string)",
        "config-install-subscribe-notpossible": "Error shown when automatically subscribing to the MediaWiki announcements mailing list fails.",
index c5e7f2e..617a3a3 100644 (file)
@@ -235,7 +235,7 @@ class JobRunner {
                        $content = stream_get_contents( $handle );
                        flock( $handle, LOCK_UN );
                        fclose( $handle );
-                       $backoffs = json_decode( $content, true ) ? : array();
+                       $backoffs = json_decode( $content, true ) ?: array();
                }
 
                return $backoffs;
@@ -253,7 +253,7 @@ class JobRunner {
                $handle = fopen( $file, 'wb+' );
                flock( $handle, LOCK_EX );
                $content = stream_get_contents( $handle );
-               $cBackoffs = json_decode( $content, true ) ? : array();
+               $cBackoffs = json_decode( $content, true ) ?: array();
                foreach ( $backoffs as $type => $timestamp ) {
                        $cBackoffs[$type] = isset( $cBackoffs[$type] ) ? $cBackoffs[$type] : 0;
                        $cBackoffs[$type] = max( $cBackoffs[$type], $backoffs[$type] );
index be7931d..ce5b972 100644 (file)
@@ -184,6 +184,7 @@ class LogPage {
 
        /**
         * Get the comment from the last addEntry() call
+        * @return string
         */
        public function getComment() {
                return $this->comment;
index 818bb25..018b58c 100644 (file)
@@ -563,6 +563,7 @@ class Exif {
 
        /**
         * Get $this->mFilteredExifData
+        * @return array
         */
        function getFilteredData() {
                return $this->mFilteredExifData;
index 984b01d..8970539 100644 (file)
@@ -1976,6 +1976,7 @@ class Article implements Page {
         * raw WikiPage fields for backwards compatibility.
         *
         * @param string $fname Field name
+        * @return mixed
         */
        public function __get( $fname ) {
                if ( property_exists( $this->mPage, $fname ) ) {
index 75fc01f..7fa4436 100644 (file)
@@ -809,6 +809,7 @@ class ParserOutput extends CacheTime {
 
        /**
         * Save space for for serialization by removing useless values
+        * @return array
         */
        public function __sleep() {
                return array_diff(
index 5f72d8d..60fd783 100644 (file)
@@ -855,7 +855,7 @@ class ResourceLoader {
                // Pre-fetch blobs
                if ( $context->shouldIncludeMessages() ) {
                        try {
-                               $blobs = MessageBlobStore::get( $this, $modules, $context->getLanguage() );
+                               $blobs = MessageBlobStore::getInstance()->get( $this, $modules, $context->getLanguage() );
                        } catch ( Exception $e ) {
                                MWExceptionHandler::logException( $e );
                                wfDebugLog(
@@ -1181,11 +1181,13 @@ class ResourceLoader {
         * Returns JS code which calls mw.loader.register with the given
         * parameters. Has three calling conventions:
         *
-        *   - ResourceLoader::makeLoaderRegisterScript( $name, $version, $dependencies, $group, $source, $skip ):
-        *       Register a single module.
+        *   - ResourceLoader::makeLoaderRegisterScript( $name, $version,
+        *        $dependencies, $group, $source, $skip
+        *     ):
+        *        Register a single module.
         *
         *   - ResourceLoader::makeLoaderRegisterScript( array( $name1, $name2 ) ):
-        *       Register modules with the given names.
+        *        Register modules with the given names.
         *
         *   - ResourceLoader::makeLoaderRegisterScript( array(
         *        array( $name1, $version1, $dependencies1, $group1, $source1, $skip1 ),
index 7e5f685..0bd6ca8 100644 (file)
@@ -483,6 +483,7 @@ class SearchHighlighter {
         * the target is category or image, leave it
         *
         * @param array $matches
+        * @return string
         */
        function linkReplace( $matches ) {
                $colon = strpos( $matches[1], ':' );
index c1dc158..2667270 100644 (file)
@@ -51,6 +51,7 @@ class ListDuplicatedFilesPage extends QueryPage {
         * However this version should be no more expensive then
         * Special:MostLinked, which seems to get handled fine
         * with however we are doing cached special pages.
+        * @return array
         */
        function getQueryInfo() {
                return array(
index 5eafd66..cea6ff8 100644 (file)
@@ -301,6 +301,7 @@ class ImageListPager extends TablePager {
         * @param int $offset
         * @param int $limit
         * @param bool $asc
+        * @return array
         */
        function reallyDoQuery( $offset, $limit, $asc ) {
                $prevTableName = $this->mTableName;
index 3f1850d..5bd69e0 100644 (file)
@@ -99,6 +99,7 @@ class MIMEsearchPage extends QueryPage {
         * that this report gives results in a logical order). As an aditional
         * note, mysql seems to by default order things by img_name ASC, which
         * is what we ideally want, so everything works out fine anyhow.
+        * @return array
         */
        function getOrderFields() {
                return array();
@@ -183,7 +184,8 @@ class MIMEsearchPage extends QueryPage {
                        'video',
                        'message',
                        'model',
-                       'multipart'
+                       'multipart',
+                       'chemical'
                );
 
                return in_array( $type, $types );
index fbb2d73..0b70bb7 100644 (file)
@@ -117,7 +117,6 @@ class SpecialNewpages extends IncludableSpecialPage {
         * Show a form for filtering namespace and username
         *
         * @param string $par
-        * @return string
         */
        public function execute( $par ) {
                $out = $this->getOutput();
index 6e04762..5c8794a 100644 (file)
@@ -97,6 +97,7 @@ class SpecialPageLanguage extends FormSpecialPage {
        /**
         *
         * @param array $data
+        * @return bool
         */
        public function onSubmit( array $data ) {
                $title = Title::newFromText( $data['pagename'] );
index 6c5401a..4add742 100644 (file)
@@ -77,6 +77,7 @@ class SpecialResetTokens extends FormSpecialPage {
        /**
         * Display appropriate message if there's nothing to do.
         * The submit button is also suppressed in this case (see alterForm()).
+        * @return array
         */
        protected function getFormFields() {
                $user = $this->getUser();
index d86de79..1499302 100644 (file)
@@ -62,8 +62,6 @@ class UploadFromChunks extends UploadFromFile {
                        }
                        $this->stash = new UploadStash( $this->repo, $this->user );
                }
-
-               return true;
        }
 
        /**
index b97e2ad..3ceb620 100644 (file)
@@ -148,6 +148,7 @@ abstract class CdbWriter {
 
        /**
         * Are we running on Windows?
+        * @return bool
         */
        protected function isWindows() {
                return substr( php_uname(), 0, 7 ) == 'Windows';
index 31a71c4..b602f78 100644 (file)
@@ -61,6 +61,7 @@ class MWCryptRand {
 
        /**
         * Initialize an initial random state based off of whatever we can find
+        * @return string
         */
        protected function initialRandomState() {
                // $_SERVER contains a variety of unstable user and system specific information
index 2000a8b..dae6810 100644 (file)
        "createacct-submit": "Submit button on vertical-layout create account form.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
        "createacct-another-submit": "Submit button of  [[Special:UserLogin/signup]] ([[Special:CreateAccount]]) when accessed by a registered user.\n\nThe original means \"create an account in addition to the one you already have\"; sometimes, but not always, it means you are going to \"Create the account on behalf of somebody else\" or \"Create account for another\".\n{{Identical|Create another account}}",
        "createacct-benefit-heading": "In vertical-layout create account form, the heading for the section describing the benefits of creating an account. See example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nIf in your language you need to know the gender of the name for the wiki (which is the subject of the English sentence), please adapt the sentence as much as you need for your translation to fit.",
-       "createacct-benefit-icon1": "In vertical-layout create account form, the CSS style for the div next to the first benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
-       "createacct-benefit-head1": "In vertical-layout create account form, the text in the heading for the first benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body1}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
+       "createacct-benefit-icon1": "In vertical-layout create account form, the CSS style for the div next to the first benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
+       "createacct-benefit-head1": "In vertical-layout create account form, the text in the heading for the first benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body1}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
        "createacct-benefit-body1": "In vertical-layout create account form, the text for the first benefit.\n\nPreceded by the message {{msg-mw|Createacct-benefit-head1}} (number of edits).\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nParameters:\n* $1 - number of edits\n{{Identical|Edit}}",
-       "createacct-benefit-icon2": "In vertical-layout create account form, the CSS style for the div next to the second benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
-       "createacct-benefit-head2": "In vertical-layout create account form, the text in the heading for the second benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body2}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
+       "createacct-benefit-icon2": "In vertical-layout create account form, the CSS style for the div next to the second benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
+       "createacct-benefit-head2": "In vertical-layout create account form, the text in the heading for the second benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body2}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
        "createacct-benefit-body2": "In vertical-layout create account form, the text for the second benefit.\n\nPreceded by the message {{msg-mw|Createacct-benefit-head2}} (number of pages).\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nParameters:\n* $1 - number of pages\n{{Identical|Page}}",
-       "createacct-benefit-icon3": "In vertical-layout create account form, the CSS style for the div next to the third benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
-       "createacct-benefit-head3": "In vertical-layout create account form, the text in the heading for the third benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body3}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup&useNew=1}} Special:UserLogin?type=signup&useNew=1]",
+       "createacct-benefit-icon3": "In vertical-layout create account form, the CSS style for the div next to the third benefit. If you replace this you will need probably need to adjust CSS.\n\nUsed as a CSS class name.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
+       "createacct-benefit-head3": "In vertical-layout create account form, the text in the heading for the third benefit. Do not edit the magic word; if you replace it you will probably need to adjust CSS.\n\nFollowed by the message {{msg-mw|Createacct-benefit-body3}}.\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]",
        "createacct-benefit-body3": "In vertical-layout create account form, the text for the third benefit.\n\nPreceded by the message {{msg-mw|Createacct-benefit-head3}} (number of contributors).\n\nSee example: [{{canonicalurl:Special:UserLogin|type=signup}} Special:UserLogin?type=signup]\n\nParameters:\n* $1 - number of contributors (users)",
        "badretype": "Used as error message when the new password and its retype do not match.",
        "userexists": "Used as error message in creating a user account.",
diff --git a/maintenance/archives/patch-fa_major_mime-chemical.sql b/maintenance/archives/patch-fa_major_mime-chemical.sql
new file mode 100644 (file)
index 0000000..be9b0ff
--- /dev/null
@@ -0,0 +1,3 @@
+ALTER TABLE /*$wgDBprefix*/filearchive
+  CHANGE  fa_major_mime fa_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical');
+
diff --git a/maintenance/archives/patch-img_major_mime-chemical.sql b/maintenance/archives/patch-img_major_mime-chemical.sql
new file mode 100644 (file)
index 0000000..4bde446
--- /dev/null
@@ -0,0 +1,3 @@
+ALTER TABLE /*$wgDBprefix*/image
+  CHANGE  img_major_mime img_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical');
+
diff --git a/maintenance/archives/patch-oi_major_mime-chemical.sql b/maintenance/archives/patch-oi_major_mime-chemical.sql
new file mode 100644 (file)
index 0000000..e3b4552
--- /dev/null
@@ -0,0 +1,3 @@
+ALTER TABLE /*$wgDBprefix*/oldimage
+  CHANGE  oi_major_mime oi_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical');
+
index 6ef4909..d1c2edd 100644 (file)
@@ -345,7 +345,6 @@ class CheckSyntax extends Maintenance {
         * or pointless ?> closing tags at the end.
         *
         * @param string $file String Path to a file to check for errors
-        * @return bool
         */
        private function checkForMistakes( $file ) {
                foreach ( $this->mNoStyleCheckPaths as $regex ) {
index 17b9a04..36760d7 100644 (file)
@@ -99,6 +99,7 @@ class FindHooks extends Maintenance {
                        $IP . '/includes/revisiondelete/',
                        $IP . '/includes/search/',
                        $IP . '/includes/site/',
+                       $IP . '/includes/skins/',
                        $IP . '/includes/specialpage/',
                        $IP . '/includes/specials/',
                        $IP . '/includes/upload/',
@@ -109,9 +110,6 @@ class FindHooks extends Maintenance {
                        $IP . '/tests/',
                        $IP . '/tests/parser/',
                        $IP . '/tests/phpunit/suites/',
-                       $IP . '/skins/',
-                       $IP . '/skins/MonoBook/',
-                       $IP . '/skins/Vector/',
                );
 
                foreach ( $pathinc as $dir ) {
index 1db53f3..d5f6834 100644 (file)
@@ -87,7 +87,7 @@ class GetConfiguration extends Maintenance {
        public function finalSetup() {
                parent::finalSetup();
 
-               $this->regex = $this->getOption( 'regex' ) ? : $this->getOption( 'iregex' );
+               $this->regex = $this->getOption( 'regex' ) ?: $this->getOption( 'iregex' );
                if ( $this->regex ) {
                        $this->regex = '/' . $this->regex . '/';
                        if ( $this->hasOption( 'iregex' ) ) {
diff --git a/maintenance/mssql/archives/patch-fa_major_mime-chemical.sql b/maintenance/mssql/archives/patch-fa_major_mime-chemical.sql
new file mode 100644 (file)
index 0000000..1836808
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABLE /*_*/filearchive
+DROP CONSTRAINT fa_major_mime_ckc;
+ALTER TABLE /*_*/filearchive
+WITH NOCHECK ADD CONSTRAINT fa_major_mime_ckc CHECK (fa_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical'));
\ No newline at end of file
diff --git a/maintenance/mssql/archives/patch-img_major_mime-chemical.sql b/maintenance/mssql/archives/patch-img_major_mime-chemical.sql
new file mode 100644 (file)
index 0000000..eed0786
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABLE /*_*/image
+DROP CONSTRAINT img_major_mime_ckc;
+ALTER TABLE /*_*/image
+WITH NOCHECK ADD CONSTRAINT img_major_mime_ckc CHECK (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical'));
\ No newline at end of file
diff --git a/maintenance/mssql/archives/patch-oi_major_mime-chemical.sql b/maintenance/mssql/archives/patch-oi_major_mime-chemical.sql
new file mode 100644 (file)
index 0000000..35482ed
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABLE /*_*/oldimage
+DROP CONSTRAINT oi_major_mime_ckc;
+ALTER TABLE /*_*/oldimage
+WITH NOCHECK ADD CONSTRAINT oi_major_mime_ckc CHECK (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical'));
\ No newline at end of file
index daaa81e..b9cd715 100644 (file)
@@ -594,7 +594,7 @@ CREATE TABLE /*_*/image (
   -- SHA-1 content hash in base-36
   img_sha1 nvarchar(32) NOT NULL default '',
 
-  CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')),
+  CONSTRAINT img_major_mime_ckc check (img_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
   CONSTRAINT img_media_type_ckc check (img_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
 );
 
@@ -639,7 +639,7 @@ CREATE TABLE /*_*/oldimage (
   oi_deleted tinyint NOT NULL default 0,
   oi_sha1 nvarchar(32) NOT NULL default '',
 
-  CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')),
+  CONSTRAINT oi_major_mime_ckc check (oi_major_mime IN('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
   CONSTRAINT oi_media_type_ckc check (oi_media_type IN('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
 );
 
@@ -700,7 +700,7 @@ CREATE TABLE /*_*/filearchive (
   -- sha1 hash of file content
   fa_sha1 nvarchar(32) NOT NULL default '',
 
-  CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart')),
+  CONSTRAINT fa_major_mime_ckc check (fa_major_mime in('unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart', 'chemical')),
   CONSTRAINT fa_media_type_ckc check (fa_media_type in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))
 );
 
diff --git a/maintenance/mssql/update-keys.sql b/maintenance/mssql/update-keys.sql
new file mode 100644 (file)
index 0000000..4d2c1c1
--- /dev/null
@@ -0,0 +1,31 @@
+-- Update keys for Microsoft SQL Server
+-- SQL to insert update keys into the initial tables after a
+-- fresh installation of MediaWiki's database.
+-- This is read and executed by the install script; you should
+-- not have to run it by itself unless doing a manual install.
+-- Insert keys here if either the unnecessary would cause heavy
+-- processing or could potentially cause trouble by lowering field
+-- sizes, adding constraints, etc.
+-- When adjusting field sizes, it is recommended removing old
+-- patches but to play safe, update keys should also inserted here.
+
+--
+-- The /*_*/ comments in this and other files are
+-- replaced with the defined table prefix by the installer
+-- and updater scripts. If you are installing or running
+-- updates manually, you will need to manually insert the
+-- table prefix if any when running these scripts.
+--
+
+INSERT INTO /*_*/updatelog
+       SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value
+       UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null
+       UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null
+       UNION SELECT 'cl_type-category_types-ck', null
+       UNION SELECT 'fa_major_mime-major_mime-ck', null
+       UNION SELECT 'fa_media_type-media_type-ck', null
+       UNION SELECT 'img_major_mime-major_mime-ck', null
+       UNION SELECT 'img_media_type-media_type-ck', null
+       UNION SELECT 'oi_major_mime-major_mime-ck', null
+       UNION SELECT 'oi_media_type-media_type-ck', null
+       UNION SELECT 'us_media_type-media_type-ck', null;
\ No newline at end of file
index 389b270..afa3ef7 100644 (file)
@@ -39,7 +39,7 @@ class MwSql extends Maintenance {
        }
 
        public function execute() {
-               $wiki = $this->getOption( 'wikidb' ) ? : false;
+               $wiki = $this->getOption( 'wikidb' ) ?: false;
                // Get the appropriate load balancer (for this wiki)
                if ( $this->hasOption( 'cluster' ) ) {
                        $lb = wfGetLBFactory()->getExternalLB( $this->getOption( 'cluster' ), $wiki );
index f181e0f..0228684 100644 (file)
@@ -847,7 +847,8 @@ CREATE TABLE /*_*/image (
 
   -- major part of a MIME media type as defined by IANA
   -- see http://www.iana.org/assignments/media-types/
-  img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
+  -- for "chemical" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS
+  img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown",
 
   -- minor part of a MIME media type as defined by IANA
   -- the minor parts are not required to adher to any standard
@@ -906,7 +907,7 @@ CREATE TABLE /*_*/oldimage (
 
   oi_metadata mediumblob NOT NULL,
   oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
-  oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
+  oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") NOT NULL default "unknown",
   oi_minor_mime varbinary(100) NOT NULL default "unknown",
   oi_deleted tinyint unsigned NOT NULL default 0,
   oi_sha1 varbinary(32) NOT NULL default ''
@@ -956,7 +957,7 @@ CREATE TABLE /*_*/filearchive (
   fa_metadata mediumblob,
   fa_bits int default 0,
   fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
-  fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
+  fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart", "chemical") default "unknown",
   fa_minor_mime varbinary(100) default "unknown",
   fa_description tinyblob,
   fa_user int unsigned default 0,
diff --git a/maintenance/update-keys.sql b/maintenance/update-keys.sql
new file mode 100644 (file)
index 0000000..d5ef924
--- /dev/null
@@ -0,0 +1,29 @@
+-- SQL to insert update keys into the initial tables after a
+-- fresh installation of MediaWiki's database.
+-- This is read and executed by the install script; you should
+-- not have to run it by itself unless doing a manual install.
+-- Insert keys here if either the unnecessary would cause heavy
+-- processing or could potentially cause trouble by lowering field
+-- sizes, adding constraints, etc.
+-- When adjusting field sizes, it is recommended removing old
+-- patches but to play safe, update keys should also inserted here.
+
+-- This is a shared file used for both MySQL and SQLite installs.
+-- Therefore inserting multiple values is not possible using the
+-- INSERT INTO VALUES syntax.
+--
+--
+-- The /*_*/ comments in this and other files are
+-- replaced with the defined table prefix by the installer
+-- and updater scripts. If you are installing or running
+-- updates manually, you will need to manually insert the
+-- table prefix if any when running these scripts.
+--
+
+INSERT INTO /*_*/updatelog
+       SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value
+       UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null
+       UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null
+       UNION SELECT 'user_groups-ug_group-patch-ug_group-length-increase-255.sql', null
+       UNION SELECT 'user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql', null
+       UNION SELECT 'user_properties-up_property-patch-up_property.sql', null;
\ No newline at end of file
index e2f47f5..01efef4 100644 (file)
@@ -30,6 +30,15 @@ function isCompatible( ua ) {
                ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 7 ) ||
                // Firefox < 3
                ( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 3 ) ||
+               // Opera < 12
+               ( ua.indexOf( 'Opera/' ) !== -1 && ( ua.indexOf( 'Version/' ) === -1 ?
+                       // "Opera/x.y"
+                       parseFloat( ua.split( 'Opera/' )[1] ) < 10 :
+                       // "Opera/9.80 ... Version/x.y"
+                       parseFloat( ua.split( 'Version/' )[1] ) < 12
+               ) ) ||
+               // "Mozilla/0.0 ... Opera x.y"
+               ( ua.indexOf( 'Opera ' ) !== -1 && parseFloat( ua.split( ' Opera ' )[1] ) < 10 ) ||
                // BlackBerry < 6
                ua.match( /BlackBerry[^\/]*\/[1-5]\./ ) ||
                // Open WebOS < 1.5
index dcab387..c3b9b3d 100644 (file)
                        'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1',
                        // Safari 5.0+
                        'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru) AppleWebKit/534.31+ (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1',
-                       // Opera 11+
-                       'Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.10',
+                       // Opera 12+ (Presto-based)
+                       'Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00',
+                       'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.17',
+                       // Opera 15+ (Chromium-based)
+                       'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36 OPR/15.0.1147.153',
+                       'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36 OPR/16.0.1196.62',
+                       'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 OPR/23.0.1522.75',
                        // Internet Explorer 7+
                        'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; en-US)',
                        'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)',
                        'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)',
                        'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)',
                        'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)',
-                       // Firefox < 3.6
+                       // Firefox < 3
                        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2',
                        'Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.1.1) Gecko/20070311 Firefox/2.0.0.1',
+                       // Opera < 12
+                       'Mozilla/5.0 (Windows NT 5.0; U) Opera 7.54 [en]',
+                       'Opera/7.54 (Windows NT 5.0; U) [en]',
+                       'Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.0',
+                       'Opera/8.0 (X11; Linux i686; U; cs)',
+                       'Opera/9.00 (X11; Linux i686; U; de)',
+                       'Opera/9.62 (X11; Linux i686; U; en) Presto/2.1.1',
+                       'Opera/9.80 (Windows NT 6.1; U; en) Presto/2.2.15 Version/10.00',
+                       'Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.10',
+                       'Opera/9.80 (Windows NT 6.1; WOW64; U; pt) Presto/2.10.229 Version/11.62',
                        // BlackBerry < 6
                        'BlackBerry9300/5.0.0.716 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/133',
                        'BlackBerry7250/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1',