From: jenkins-bot Date: Wed, 28 Feb 2018 22:04:13 +0000 (+0000) Subject: Merge "Database: Add batching to non-native insertSelect()" X-Git-Tag: 1.31.0-rc.0~483 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=512e86f020f01055a53ee8cab5253bcd7ac5179d;hp=aefb143a8e8c963d6fedb471bbdace284be88196;p=lhc%2Fweb%2Fwiklou.git Merge "Database: Add batching to non-native insertSelect()" --- diff --git a/includes/Block.php b/includes/Block.php index e23a8ff143..4e878d1045 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -539,10 +539,7 @@ class Block { $dbw = wfGetDB( DB_MASTER ); } - # Periodic purge via commit hooks - if ( mt_rand( 0, 9 ) == 0 ) { - self::purgeExpired(); - } + self::purgeExpired(); $row = $this->getDatabaseArray( $dbw ); @@ -1141,11 +1138,14 @@ class Block { wfGetDB( DB_MASTER ), __METHOD__, function ( IDatabase $dbw, $fname ) { - $dbw->delete( - 'ipblocks', + $ids = $dbw->selectFieldValues( 'ipblocks', + 'ipb_id', [ 'ipb_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ], $fname ); + if ( $ids ) { + $dbw->delete( 'ipblocks', [ 'ipb_id' => $ids ], $fname ); + } } ) ); } diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 8c843c4438..783de1c0c4 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -246,6 +246,9 @@ class FileDeleteForm { private function showForm() { global $wgOut, $wgUser, $wgRequest; + $conf = RequestContext::getMain()->getConfig(); + $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; + if ( $wgUser->isAllowed( 'suppressrevision' ) ) { $suppress = " @@ -258,6 +261,8 @@ class FileDeleteForm { $suppress = ''; } + $wgOut->addModules( 'mediawiki.action.delete.file' ); + $checkWatch = $wgUser->getBoolOption( 'watchdeletion' ) || $wgUser->isWatched( $this->title ); $form = Xml::openElement( 'form', [ 'method' => 'post', 'action' => $this->getAction(), 'id' => 'mw-img-deleteconfirm' ] ) . @@ -286,8 +291,15 @@ class FileDeleteForm { Xml::label( wfMessage( 'filedelete-otherreason' )->text(), 'wpReason' ) . " " . - Xml::input( 'wpReason', 60, $wgRequest->getText( 'wpReason' ), - [ 'type' => 'text', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason' ] ) . + Xml::input( 'wpReason', 60, $wgRequest->getText( 'wpReason' ), [ + 'type' => 'text', + // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP + // (e.g. emojis) count for two each. This limit is overridden in JS to instead count + // Unicode codepoints (or 255 UTF-8 bytes for old schema). + 'maxlength' => $oldCommentSchema ? 255 : CommentStore::COMMENT_CHARACTER_LIMIT, + 'tabindex' => '2', + 'id' => 'wpReason' + ] ) . " {$suppress}"; diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index 8d7a61c9ec..3bbe399b45 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -7,7 +7,7 @@ }, "apihelp-main-summary": "", - "apihelp-main-extended-description": "
\n* [[mw:Special:MyLanguage/API:Main_page|Documentation]]\n* [[mw:Special:MyLanguage/API:FAQ|FAQ]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api Mailing list]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce API Announcements]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Bugs & requests]\n
\nStatus: All features shown on this page should be working, but the API is still in active development, and may change at any time. Subscribe to [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ the mediawiki-api-announce mailing list] for notice of updates.\n\nErroneous requests: When erroneous requests are sent to the API, an HTTP header will be sent with the key \"MediaWiki-API-Error\" and then both the value of the header and the error code sent back will be set to the same value. For more information see [[mw:Special:MyLanguage/API:Errors_and_warnings|API: Errors and warnings]].\n\n

Testing: For ease of testing API requests, see [[Special:ApiSandbox]].

", + "apihelp-main-extended-description": "
\n* [[mw:Special:MyLanguage/API:Main_page|Documentation]]\n* [[mw:Special:MyLanguage/API:FAQ|FAQ]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api Mailing list]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce API Announcements]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Bugs & requests]\n
\nStatus: The MediaWiki API is a mature and stable interface that is actively supported and improved. While we try to avoid it, we may ocassionally need to make breaking changes; subscribe to [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ the mediawiki-api-announce mailing list] for notice of updates.\n\nErroneous requests: When erroneous requests are sent to the API, an HTTP header will be sent with the key \"MediaWiki-API-Error\" and then both the value of the header and the error code sent back will be set to the same value. For more information see [[mw:Special:MyLanguage/API:Errors_and_warnings|API: Errors and warnings]].\n\n

Testing: For ease of testing API requests, see [[Special:ApiSandbox]].

", "apihelp-main-param-action": "Which action to perform.", "apihelp-main-param-format": "The format of the output.", "apihelp-main-param-maxlag": "Maximum lag can be used when MediaWiki is installed on a database replicated cluster. To save actions causing any more site replication lag, this parameter can make the client wait until the replication lag is less than the specified value. In case of excessive lag, error code maxlag is returned with a message like Waiting for $host: $lag seconds lagged.
See [[mw:Special:MyLanguage/Manual:Maxlag_parameter|Manual: Maxlag parameter]] for more information.", diff --git a/includes/api/i18n/pt.json b/includes/api/i18n/pt.json index 82a7ee137c..f69fb08a26 100644 --- a/includes/api/i18n/pt.json +++ b/includes/api/i18n/pt.json @@ -364,7 +364,7 @@ "apihelp-parse-param-disablepp": "Em vez deste, usar $1disablelimitreport.", "apihelp-parse-param-disableeditsection": "Omitir as hiperligações para edição da secção no resultado da análise sintática.", "apihelp-parse-param-disabletidy": "Não fazer a limpeza do HTML (isto é, o ''tidy'') no resultado da análise sintática.", - "apihelp-parse-param-disablestylededuplication": "Não desduplicar os estilos especificados em linha na saída do analisador sintático.", + "apihelp-parse-param-disablestylededuplication": "Não desduplicar as folhas de estilo internas (etiquetas - + + !! html/php+tidy
@@ -29917,6 +29915,86 @@ wgRawHtml=1
!! end +!! test +Validating that + + + +But if it's on a line with other content, let it be wrapped. + + bar + +foo + +foo bar + +And the same if we have non-paragraph-breaking whitespace + +foo + +bar +!! html/php +

A style tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph +

+ + +

But if it's on a line with other content, let it be wrapped. +

bar +

foo +

foo bar +

And the same if we have non-paragraph-breaking whitespace +

foo + +bar +

+!! end + +!! test +Validating that isn't wrapped in a paragraph (T186965) +!! options +styletag=1 +!! wikitext +A link tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph + + + + + +But if it's on a line with other content, let it be wrapped. + + bar + +foo + +foo bar + +And the same if we have non-paragraph-breaking whitespace + +foo + +bar +!! html/php +

A link tag, by itself or with other style/link tags, shouldn't be wrapped in a paragraph +

+ + +

But if it's on a line with other content, let it be wrapped. +

bar +

foo +

foo bar +

And the same if we have non-paragraph-breaking whitespace +

foo + +bar +

+!! end + !! test Decoding of HTML entities in headings and links for IDs and link fragments (T103714) !! config diff --git a/tests/phpunit/includes/shell/FirejailCommandTest.php b/tests/phpunit/includes/shell/FirejailCommandTest.php index 199393c692..681c3dcda0 100644 --- a/tests/phpunit/includes/shell/FirejailCommandTest.php +++ b/tests/phpunit/includes/shell/FirejailCommandTest.php @@ -34,7 +34,7 @@ class FirejailCommandTest extends PHPUnit\Framework\TestCase { $limit = "/bin/bash '$IP/includes/shell/limit.sh'"; $profile = "--profile=$IP/includes/shell/firejail.profile"; $blacklist = '--blacklist=' . realpath( MW_CONFIG_FILE ); - $default = "$blacklist --noroot --seccomp=@default --private-dev"; + $default = "$blacklist --noroot --seccomp --private-dev"; return [ [ 'No restrictions', @@ -58,12 +58,12 @@ class FirejailCommandTest extends PHPUnit\Framework\TestCase { [ 'seccomp', 'ls', Shell::SECCOMP, - "$limit 'firejail --quiet $profile --seccomp=@default -- '\''ls'\''' $env" + "$limit 'firejail --quiet $profile --seccomp -- '\''ls'\''' $env" ], [ 'seccomp & no execve', 'ls', Shell::SECCOMP | Shell::NO_EXECVE, - "$limit 'firejail --quiet $profile --shell=none --seccomp=@default,execve -- '\''ls'\''' $env" + "$limit 'firejail --quiet $profile --shell=none --seccomp=execve -- '\''ls'\''' $env" ], ]; } diff --git a/tests/phpunit/languages/classes/LanguageCrhTest.php b/tests/phpunit/languages/classes/LanguageCrhTest.php index d99fc26729..7c99614e61 100644 --- a/tests/phpunit/languages/classes/LanguageCrhTest.php +++ b/tests/phpunit/languages/classes/LanguageCrhTest.php @@ -55,6 +55,22 @@ class LanguageCrhTest extends LanguageClassesTestCase { ], 'инструменталь instrumental гургуль gürgül тюшюнмемек tüşünmemek' ], + [ // recent problem words, part 1 + [ + 'crh' => 'künü куню sürgünligi сюргюнлиги özü озю etti этти', + 'crh-cyrl' => 'куню куню сюргюнлиги сюргюнлиги озю озю этти этти', + 'crh-latn' => 'künü künü sürgünligi sürgünligi özü özü etti etti', + ], + 'künü куню sürgünligi сюргюнлиги özü озю etti этти' + ], + [ // recent problem words, part 2 + [ + 'crh' => 'esas эсас dört дёрт keldi кельди', + 'crh-cyrl' => 'эсас эсас дёрт дёрт кельди кельди', + 'crh-latn' => 'esas esas dört dört keldi keldi', + ], + 'esas эсас dört дёрт keldi кельди' + ], [ // multi part words [ 'crh' => 'эки юз eki yüz', @@ -63,7 +79,7 @@ class LanguageCrhTest extends LanguageClassesTestCase { ], 'эки юз eki yüz' ], - [ // ALL CAPS, made up acronyms + [ // ALL CAPS, made up acronyms (not 100% sure these are correct) [ 'crh' => 'ÑAB QIC ĞUK COT НЪАБ КЪЫДж ГЪУК ДЖОТ CA ДЖА', 'crh-cyrl' => 'НЪАБ КЪЫДж ГЪУК ДЖОТ НЪАБ КЪЫДж ГЪУК ДЖОТ ДЖА ДЖА',