[MediaWiki-commits] [Gerrit] Allow configurable per-key HMAC algorithm - change (mediawiki...SecureHTML)
Fo0bar has submitted this change and it was merged. Change subject: Allow configurable per-key HMAC algorithm .. Allow configurable per-key HMAC algorithm Change-Id: Ifba94953278ff3f8d26578c8c9084187b1cc20b5 --- M SecureHTML.php M SpecialSecureHTML.php 2 files changed, 28 insertions(+), 6 deletions(-) Approvals: Fo0bar: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/SecureHTML.php b/SecureHTML.php index d2f5ed9..da4efb4 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -92,18 +92,29 @@ # If the desired key name is not available, assume the first one. $keyname = ( isset( $argv['keyname'] ) ? $argv['keyname'] : $keynames[0] ); - # The key secret. - if ( array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { - $keysecret = $wgSecureHTMLSecrets[$keyname]; - } else { + # Key secret configuration. + $keyalgorithm = 'sha256'; + if ( !array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { # Respond with "invalid hash" instead of something like "invalid # key name", to avoid leaking the existence of a key name due to # dictionary attack. return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); } + if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { + if ( array_key_exists( 'secret', $wgSecureHTMLSecrets[$keyname] ) ) { + $keysecret = $wgSecureHTMLSecrets[$keyname]['secret']; + } else { + return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + } + if ( array_key_exists( 'algorithm', $wgSecureHTMLSecrets[$keyname] ) ) { + $keyalgorithm = $wgSecureHTMLSecrets[$keyname]['algorithm']; + } + } else { + $keysecret = $wgSecureHTMLSecrets[$keyname]; + } # Compute a test hash. - $testhash = hash_hmac( 'sha256', $input, $keysecret ); + $testhash = hash_hmac( $keyalgorithm, $input, $keysecret ); # If the test hash matches the supplied hash, return the raw HTML. Otherwise, error. if ( $testhash == $argv['hash'] ) { diff --git a/SpecialSecureHTML.php b/SpecialSecureHTML.php index 21780c9..8121725 100644 --- a/SpecialSecureHTML.php +++ b/SpecialSecureHTML.php @@ -31,8 +31,19 @@ $html = $request->getText( 'wpsecurehtmlraw' ); $html_lf = str_replace( "\r\n", "\n", $html ); + if ( !array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { + $keyname = ''; + } + + $keyalgorithm = 'sha256'; + if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { + if ( array_key_exists( 'algorithm', $wgSecureHTMLSecrets[$keyname] ) ) { + $keyalgorithm = $wgSecureHTMLSecrets[$keyname]['algorithm']; + } + } + if ( $keysecret && $html ) { - $generated = '<' . $wgSecureHTMLTag . ' ' . ( $keyname ? 'keyname="' . htmlspecialchars( $keyname ) . '" ' : '' ) . 'hash="' . hash_hmac( 'sha256', $html_lf, $keysecret ) . '">'; + $generated = '<' . $wgSecureHTMLTag . ' ' . ( $keyname ? 'keyname="' . htmlspecialchars( $keyname ) . '" ' : '' ) . 'hash="' . hash_hmac( $keyalgorithm, $html_lf, $keysecret ) . '">'; $generated .= $html_lf; $generated .= ''; $output->addWikiText( '== ' . wfMessage( 'securehtml-generatedoutput-title' ) . ' ==' ); -- To view, visit https://gerrit.wikimedia.org/r/300742 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifba94953278ff3f8d26578c8c9084187b1cc20b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar Gerrit-Reviewer: Fo0bar Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use Html::rawElement class=error for inline secureHTMLRender... - change (mediawiki...SecureHTML)
Fo0bar has uploaded a new change for review. https://gerrit.wikimedia.org/r/300743 Change subject: Use Html::rawElement class=error for inline secureHTMLRender errors .. Use Html::rawElement class=error for inline secureHTMLRender errors Change-Id: I8f5160bb3ba098e8e67f87e2c7215eabfd3f2e70 --- M SecureHTML.php 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecureHTML refs/changes/43/300743/1 diff --git a/SecureHTML.php b/SecureHTML.php index da4efb4..90f1fd1 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -78,12 +78,12 @@ # The hash attribute is required. if ( !isset( $argv['hash'] ) ) { - return( '' . wfMessage( 'securehtml-hashrequired' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-hashrequired' ) ) ); } # If the array is empty, there is no possible way this will work. if ( count( $wgSecureHTMLSecrets ) == 0 ) { - return( '' . wfMessage( 'securehtml-nokeys' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-nokeys' ) ) ); } # Get a list of key names. @@ -98,13 +98,13 @@ # Respond with "invalid hash" instead of something like "invalid # key name", to avoid leaking the existence of a key name due to # dictionary attack. - return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { if ( array_key_exists( 'secret', $wgSecureHTMLSecrets[$keyname] ) ) { $keysecret = $wgSecureHTMLSecrets[$keyname]['secret']; } else { - return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } if ( array_key_exists( 'algorithm', $wgSecureHTMLSecrets[$keyname] ) ) { $keyalgorithm = $wgSecureHTMLSecrets[$keyname]['algorithm']; @@ -120,7 +120,7 @@ if ( $testhash == $argv['hash'] ) { return( array( $input, 'markerType' => 'nowiki' ) ); } else { - return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/300743 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f5160bb3ba098e8e67f87e2c7215eabfd3f2e70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use Html::rawElement class=error for inline secureHTMLRender... - change (mediawiki...SecureHTML)
Fo0bar has submitted this change and it was merged. Change subject: Use Html::rawElement class=error for inline secureHTMLRender errors .. Use Html::rawElement class=error for inline secureHTMLRender errors Change-Id: I8f5160bb3ba098e8e67f87e2c7215eabfd3f2e70 --- M SecureHTML.php 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Fo0bar: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/SecureHTML.php b/SecureHTML.php index da4efb4..90f1fd1 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -78,12 +78,12 @@ # The hash attribute is required. if ( !isset( $argv['hash'] ) ) { - return( '' . wfMessage( 'securehtml-hashrequired' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-hashrequired' ) ) ); } # If the array is empty, there is no possible way this will work. if ( count( $wgSecureHTMLSecrets ) == 0 ) { - return( '' . wfMessage( 'securehtml-nokeys' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-nokeys' ) ) ); } # Get a list of key names. @@ -98,13 +98,13 @@ # Respond with "invalid hash" instead of something like "invalid # key name", to avoid leaking the existence of a key name due to # dictionary attack. - return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { if ( array_key_exists( 'secret', $wgSecureHTMLSecrets[$keyname] ) ) { $keysecret = $wgSecureHTMLSecrets[$keyname]['secret']; } else { - return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } if ( array_key_exists( 'algorithm', $wgSecureHTMLSecrets[$keyname] ) ) { $keyalgorithm = $wgSecureHTMLSecrets[$keyname]['algorithm']; @@ -120,7 +120,7 @@ if ( $testhash == $argv['hash'] ) { return( array( $input, 'markerType' => 'nowiki' ) ); } else { - return( '' . wfMessage( 'securehtml-invalidhash' ) . '' . "\n" ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/300743 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f5160bb3ba098e8e67f87e2c7215eabfd3f2e70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar Gerrit-Reviewer: Fo0bar Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] replace.py: allow to edit most recent text - change (pywikibot/core)
Mpaa has uploaded a new change for review. https://gerrit.wikimedia.org/r/300744 Change subject: replace.py: allow to edit most recent text .. replace.py: allow to edit most recent text Allow to edit the latest version of the text. This allows to make changes avoiding that replacements are reapplied again. It is useful to make changes that should not be caught by replacements or amend unwanted fixes, in complex replacement cases. Change-Id: I32c46820117415ee337844d17556accfae746a79 --- M scripts/replace.py 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/44/300744/1 diff --git a/scripts/replace.py b/scripts/replace.py index 7e3f0d9..a31f30f 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -698,13 +698,13 @@ continue applied = set() new_text = original_text +last_text = None while True: if self.isTextExcepted(new_text): pywikibot.output(u'Skipping %s because it contains text ' u'that is on the exceptions list.' % page.title(asLink=True)) break -last_text = None while new_text != last_text: last_text = new_text new_text = self.apply_replacements(last_text, applied, @@ -733,7 +733,7 @@ break choice = pywikibot.input_choice( u'Do you want to accept these changes?', -[('Yes', 'y'), ('No', 'n'), ('Edit', 'e'), +[('Yes', 'y'), ('No', 'n'), ('Edit', 'e'), ('edit Latest', 'l'), ('open in Browser', 'b'), ('all', 'a')], default='N') if choice == 'e': @@ -742,6 +742,14 @@ # if user didn't press Cancel if as_edited and as_edited != new_text: new_text = as_edited +continue +if choice == 'l': +editor = editarticle.TextEditor() +as_edited = editor.edit(new_text) +# if user didn't press Cancel +if as_edited and as_edited != new_text: +new_text = as_edited +last_text = as_edited continue if choice == 'b': pywikibot.bot.open_webbrowser(page) @@ -752,6 +760,7 @@ % page.title()) break new_text = original_text +last_text = None continue if choice == 'a': self.options['always'] = True -- To view, visit https://gerrit.wikimedia.org/r/300744 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32c46820117415ee337844d17556accfae746a79 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mpaa ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Singleton PDO For the pending database - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/300745 Change subject: Singleton PDO For the pending database .. Singleton PDO For the pending database More convenient for testing. Note that we assume an app will only use one pending database per run. Change-Id: I3be06d1a2dad92661945baa9d5922eead7bfb603 --- M Core/DataStores/PendingDatabase.php 1 file changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/45/300745/1 diff --git a/Core/DataStores/PendingDatabase.php b/Core/DataStores/PendingDatabase.php index 50e2454..1900541 100644 --- a/Core/DataStores/PendingDatabase.php +++ b/Core/DataStores/PendingDatabase.php @@ -13,19 +13,23 @@ /** * @var PDO +* We do the silly singleton thing for convenient testing with in-memory +* databases that would otherwise not be shared between components. */ - protected $db; + protected static $db; protected function __construct() { $config = Context::get()->getConfiguration(); - $this->db = $config->object( 'data-store/pending-db' ); + if ( !self::$db ) { + self::$db = $config->object( 'data-store/pending-db' ); + } } /** * @return PDO */ public function getDatabase() { - return $this->db; + return self::$db; } public static function get() { @@ -80,7 +84,7 @@ $paramList = ':' . implode( ', :', array_keys( $dbRecord ) ); $insert = "INSERT INTO pending ( $fieldList ) values ( $paramList );"; - $prepared = $this->db->prepare( $insert ); + $prepared = self::$db->prepare( $insert ); foreach ( $dbRecord as $field => $value ) { $prepared->bindValue( @@ -100,7 +104,7 @@ * @return array|null Record related to a transaction, or null if nothing matches */ public function fetchMessageByGatewayOrderId( $gatewayName, $orderId ) { - $prepared = $this->db->prepare( ' + $prepared = self::$db->prepare( ' select * from pending where gateway = :gateway and order_id = :order_id @@ -122,7 +126,7 @@ * @return array|null Message or null if nothing is found. */ public function fetchMessageByGatewayOldest( $gatewayName ) { - $prepared = $this->db->prepare( ' + $prepared = self::$db->prepare( ' select * from pending where gateway = :gateway order by date asc @@ -150,7 +154,7 @@ * @return array|null Message or null if nothing is found. */ public function fetchMessageByGatewayFirstSinceId( $gatewayName, $offsetId = 0 ) { - $prepared = $this->db->prepare( ' + $prepared = self::$db->prepare( ' select * from pending where gateway = :gateway and id > :offset_id @@ -174,7 +178,7 @@ * @param array $message */ public function deleteMessage( $message ) { - $prepared = $this->db->prepare( ' + $prepared = self::$db->prepare( ' delete from pending where gateway = :gateway and order_id = :order_id' ); -- To view, visit https://gerrit.wikimedia.org/r/300745 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3be06d1a2dad92661945baa9d5922eead7bfb603 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] New Wikidata Build - 2016-07-24T10:00:01+0000 - change (mediawiki...Wikidata)
WikidataBuilder has uploaded a new change for review. https://gerrit.wikimedia.org/r/300746 Change subject: New Wikidata Build - 2016-07-24T10:00:01+ .. New Wikidata Build - 2016-07-24T10:00:01+ Change-Id: I492d5b5cb998a62322b400df04a2a22d6e46beba --- M composer.lock A extensions/ArticlePlaceholder/includes/ItemNotabilityFilter.php M extensions/ArticlePlaceholder/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua M extensions/ArticlePlaceholder/includes/SearchHookHandler.php A extensions/ArticlePlaceholder/tests/phpunit/includes/ItemNotabilityFilterTest.php M extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php M extensions/ExternalValidation/tests/phpunit/Api/RunCrossCheckTest.php M extensions/ExternalValidation/tests/phpunit/Specials/SpecialCrossCheckTest.php M extensions/MediaInfo/WikibaseMediaInfo.entitytypes.php M extensions/MediaInfo/composer.json M extensions/MediaInfo/extension.json M extensions/MediaInfo/src/Content/MediaInfoHandler.php M extensions/MediaInfo/src/DataModel/MediaInfoId.php M extensions/MediaInfo/src/Services/FilePageLookup.php M extensions/MediaInfo/src/View/MediaInfoView.php M extensions/MediaInfo/src/WikibaseMediaInfoHooks.php M extensions/MediaInfo/tests/phpunit/composer/DataModel/MediaInfoIdTest.php M extensions/MediaInfo/tests/phpunit/composer/DataModel/Serialization/MediaInfoSerializerTest.php M extensions/MediaInfo/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php M extensions/MediaInfo/tests/phpunit/mediawiki/View/MediaInfoViewTest.php M extensions/MediaInfo/tests/phpunit/mediawiki/WikibaseMediaInfoHooksTest.php M extensions/Wikibase/client/i18n/lij.json M extensions/Wikibase/client/i18n/nn.json M extensions/Wikibase/client/i18n/wuu.json M extensions/Wikibase/lib/i18n/ko.json M extensions/Wikibase/lib/i18n/nn.json M extensions/Wikibase/lib/includes/Store/EntityStore.php M extensions/Wikibase/lib/includes/Store/WikiPagePropertyOrderProvider.php M extensions/Wikibase/lib/tests/phpunit/MockRepository.php M extensions/Wikibase/repo/Wikibase.hooks.php M extensions/Wikibase/repo/i18n/af.json M extensions/Wikibase/repo/i18n/ar.json M extensions/Wikibase/repo/i18n/ast.json M extensions/Wikibase/repo/i18n/be-tarask.json M extensions/Wikibase/repo/i18n/bn.json M extensions/Wikibase/repo/i18n/ca.json M extensions/Wikibase/repo/i18n/ce.json M extensions/Wikibase/repo/i18n/ckb.json M extensions/Wikibase/repo/i18n/cs.json M extensions/Wikibase/repo/i18n/da.json M extensions/Wikibase/repo/i18n/de.json M extensions/Wikibase/repo/i18n/dsb.json M extensions/Wikibase/repo/i18n/el.json M extensions/Wikibase/repo/i18n/en.json M extensions/Wikibase/repo/i18n/es.json M extensions/Wikibase/repo/i18n/et.json M extensions/Wikibase/repo/i18n/fa.json M extensions/Wikibase/repo/i18n/fi.json M extensions/Wikibase/repo/i18n/fr.json M extensions/Wikibase/repo/i18n/gl.json M extensions/Wikibase/repo/i18n/hak.json M extensions/Wikibase/repo/i18n/he.json M extensions/Wikibase/repo/i18n/hsb.json M extensions/Wikibase/repo/i18n/hu.json M extensions/Wikibase/repo/i18n/id.json M extensions/Wikibase/repo/i18n/ilo.json M extensions/Wikibase/repo/i18n/is.json M extensions/Wikibase/repo/i18n/it.json M extensions/Wikibase/repo/i18n/ja.json M extensions/Wikibase/repo/i18n/ka.json M extensions/Wikibase/repo/i18n/ko.json M extensions/Wikibase/repo/i18n/lb.json M extensions/Wikibase/repo/i18n/lki.json M extensions/Wikibase/repo/i18n/lt.json M extensions/Wikibase/repo/i18n/min.json M extensions/Wikibase/repo/i18n/mk.json M extensions/Wikibase/repo/i18n/ms.json M extensions/Wikibase/repo/i18n/nap.json M extensions/Wikibase/repo/i18n/nb.json M extensions/Wikibase/repo/i18n/nl.json M extensions/Wikibase/repo/i18n/nn.json M extensions/Wikibase/repo/i18n/or.json M extensions/Wikibase/repo/i18n/pl.json M extensions/Wikibase/repo/i18n/pms.json M extensions/Wikibase/repo/i18n/pt-br.json M extensions/Wikibase/repo/i18n/pt.json M extensions/Wikibase/repo/i18n/qqq.json M extensions/Wikibase/repo/i18n/ro.json M extensions/Wikibase/repo/i18n/ru.json M extensions/Wikibase/repo/i18n/scn.json M extensions/Wikibase/repo/i18n/sgs.json M extensions/Wikibase/repo/i18n/sh.json M extensions/Wikibase/repo/i18n/sr-ec.json M extensions/Wikibase/repo/i18n/sr-el.json M extensions/Wikibase/repo/i18n/sv.json M extensions/Wikibase/repo/i18n/tg-cyrl.json M extensions/Wikibase/repo/i18n/tr.json M extensions/Wikibase/repo/i18n/uk.json M extensions/Wikibase/repo/i18n/vec.json M extensions/Wikibase/repo/i18n/vi.json M extensions/Wikibase/repo/i18n/yi.json M extensions/Wikibase/repo/i18n/zh-hans.json M extensions/Wikibase/repo/i18n/zh-hant.json M extensions/Wikibase/repo/includes/Api/EditEntity.php M extensions/Wikibase/repo/includes/Api/ModifyEntity.php M extensions/Wikibase/repo/includes/Content/EntityHandler.php M extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php M extensions/Wikibase/repo/includes/WikibaseRepo.ph
[MediaWiki-commits] [Gerrit] registration: Update conversion script for manifest_version 2 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: registration: Update conversion script for manifest_version 2 .. registration: Update conversion script for manifest_version 2 Config settings are now an object, with the value set as the 'value' key. Change-Id: Iba3999fdfc8994d50331825c9a416334db602e46 --- M maintenance/convertExtensionToRegistration.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 7c87e10..6d2a0e9 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -120,7 +120,7 @@ $this->hasWarning = true; } elseif ( strpos( $name, $configPrefix ) === 0 ) { // Most likely a config setting - $this->json['config'][substr( $name, strlen( $configPrefix ) )] = $value; + $this->json['config'][substr( $name, strlen( $configPrefix ) )] = [ 'value' => $value ]; } elseif ( $configPrefix !== 'wg' && strpos( $name, 'wg' ) === 0 ) { // Warn about this $this->output( 'Warning: Skipped global "' . $name . '" (' . -- To view, visit https://gerrit.wikimedia.org/r/300668 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba3999fdfc8994d50331825c9a416334db602e46 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] registration: Fix merge_strategy in manifest_version 2 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: registration: Fix merge_strategy in manifest_version 2 .. registration: Fix merge_strategy in manifest_version 2 merge_strategy is set in $data, which is the definition of the config setting, not the default value of it ($value). Change-Id: I12ee95892b2c157bb0beb97cf2cd5ef920b7d52e --- M includes/registration/ExtensionProcessor.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 12218ce..0bf2842 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -392,7 +392,7 @@ foreach ( $info['config'] as $key => $data ) { $value = $data['value']; if ( isset( $value['merge_strategy'] ) ) { - $value[ExtensionRegistry::MERGE_STRATEGY] = $value['merge_strategy']; + $value[ExtensionRegistry::MERGE_STRATEGY] = $data['merge_strategy']; } $this->globals["$prefix$key"] = $value; } -- To view, visit https://gerrit.wikimedia.org/r/300669 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I12ee95892b2c157bb0beb97cf2cd5ef920b7d52e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Convert wikimedia_sites to use requests - change (pywikibot/core)
MtDu has uploaded a new change for review. https://gerrit.wikimedia.org/r/300747 Change subject: Convert wikimedia_sites to use requests .. Convert wikimedia_sites to use requests Bug: T130524 Change-Id: I2a076683a7de84b3b3ad05947ba02383fc1b6d8c --- M scripts/maintenance/wikimedia_sites.py 1 file changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/47/300747/1 diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py index 3c56c28..a3d4a2d 100755 --- a/scripts/maintenance/wikimedia_sites.py +++ b/scripts/maintenance/wikimedia_sites.py @@ -14,6 +14,7 @@ import codecs import re +import requests import sys from xml.etree import cElementTree @@ -21,11 +22,6 @@ import pywikibot from pywikibot.family import Family - -if sys.version_info[0] > 2: -from urllib.request import urlopen -else: -from urllib import urlopen URL = 'https://wikistats.wmflabs.org/api.php?action=dump&table=%s&format=xml' @@ -52,7 +48,7 @@ original = Family.load(family).languages_by_size obsolete = Family.load(family).obsolete -feed = urlopen(URL % familiesDict[family]) +feed = requests.get(URL % familiesDict[family]) tree = cElementTree.parse(feed) new = [] -- To view, visit https://gerrit.wikimedia.org/r/300747 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a076683a7de84b3b3ad05947ba02383fc1b6d8c Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: MtDu ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Session: Improvements to encryption functionality - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Session: Improvements to encryption functionality .. Session: Improvements to encryption functionality * Use CBC mode if CTR is unavailable, since the older method should be more commonly supported. * Apply PKCS7 padding manually when using mcrypt, since mcrypt zero-pads instead. This didn't matter for CTR because the effective blocksize is 1, but it does for CBC. OpenSSL uses PKCS7 padding for CBC mode by default, so we don't have to worry about it there. Bug: T136587 Change-Id: I7290b1a7aa64df70f4ab10eee2080141528c4788 --- M includes/session/Session.php 1 file changed, 49 insertions(+), 18 deletions(-) Approvals: Brian Wolff: Looks good to me, approved Gergő Tisza: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/session/Session.php b/includes/session/Session.php index 719f905..8fa212e 100644 --- a/includes/session/Session.php +++ b/includes/session/Session.php @@ -46,6 +46,9 @@ * @since 1.27 */ final class Session implements \Countable, \Iterator, \ArrayAccess { + /** @var null|string[] Encryption algorithm to use */ + private static $encryptionAlgorithm = null; + /** @var SessionBackend Session backend */ private $backend; @@ -409,24 +412,42 @@ * Decide what type of encryption to use, based on system capabilities. * @return array */ - private function getEncryptionAlgorithm() { + private static function getEncryptionAlgorithm() { global $wgSessionInsecureSecrets; - if ( - function_exists( 'openssl_encrypt' ) - && in_array( 'aes-256-ctr', openssl_get_cipher_methods(), true ) - ) { - return [ 'openssl', 'aes-256-ctr' ]; - } elseif ( - function_exists( 'mcrypt_encrypt' ) - && in_array( 'rijndael-128', mcrypt_list_algorithms(), true ) - && in_array( 'ctr', mcrypt_list_modes(), true ) - ) { - return [ 'mcrypt', 'rijndael-128', 'ctr' ]; - } elseif ( $wgSessionInsecureSecrets ) { - // @todo: import a pure-PHP library for AES instead of this - return [ 'insecure' ]; - } else { + if ( self::$encryptionAlgorithm === null ) { + if ( function_exists( 'openssl_encrypt' ) ) { + $methods = openssl_get_cipher_methods(); + if ( in_array( 'aes-256-ctr', $methods, true ) ) { + self::$encryptionAlgorithm = [ 'openssl', 'aes-256-ctr' ]; + return self::$encryptionAlgorithm; + } + if ( in_array( 'aes-256-cbc', $methods, true ) ) { + self::$encryptionAlgorithm = [ 'openssl', 'aes-256-cbc' ]; + return self::$encryptionAlgorithm; + } + } + + if ( function_exists( 'mcrypt_encrypt' ) + && in_array( 'rijndael-128', mcrypt_list_algorithms(), true ) + ) { + $modes = mcrypt_list_modes(); + if ( in_array( 'ctr', $modes, true ) ) { + self::$encryptionAlgorithm = [ 'mcrypt', 'rijndael-128', 'ctr' ]; + return self::$encryptionAlgorithm; + } + if ( in_array( 'cbc', $modes, true ) ) { + self::$encryptionAlgorithm = [ 'mcrypt', 'rijndael-128', 'cbc' ]; + return self::$encryptionAlgorithm; + } + } + + if ( $wgSessionInsecureSecrets ) { + // @todo: import a pure-PHP library for AES instead of this + self::$encryptionAlgorithm = [ 'insecure' ]; + return self::$encryptionAlgorithm; + } + throw new \BadMethodCallException( 'Encryption is not available. You really should install the PHP OpenSSL extension, ' . 'or failing that the mcrypt extension. But if you really can\'t and you\'re willing ' . @@ -435,6 +456,7 @@ ); } + return self::$encryptionAlgorithm; } /** @@ -455,7 +477,7 @@ // Encrypt // @to
[MediaWiki-commits] [Gerrit] New Wikidata Build - 2016-07-24T10:00:01+0000 - change (mediawiki...Wikidata)
jenkins-bot has submitted this change and it was merged. Change subject: New Wikidata Build - 2016-07-24T10:00:01+ .. New Wikidata Build - 2016-07-24T10:00:01+ Change-Id: I492d5b5cb998a62322b400df04a2a22d6e46beba --- M composer.lock A extensions/ArticlePlaceholder/includes/ItemNotabilityFilter.php M extensions/ArticlePlaceholder/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua M extensions/ArticlePlaceholder/includes/SearchHookHandler.php A extensions/ArticlePlaceholder/tests/phpunit/includes/ItemNotabilityFilterTest.php M extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php M extensions/ExternalValidation/tests/phpunit/Api/RunCrossCheckTest.php M extensions/ExternalValidation/tests/phpunit/Specials/SpecialCrossCheckTest.php M extensions/MediaInfo/WikibaseMediaInfo.entitytypes.php M extensions/MediaInfo/composer.json M extensions/MediaInfo/extension.json M extensions/MediaInfo/src/Content/MediaInfoHandler.php M extensions/MediaInfo/src/DataModel/MediaInfoId.php M extensions/MediaInfo/src/Services/FilePageLookup.php M extensions/MediaInfo/src/View/MediaInfoView.php M extensions/MediaInfo/src/WikibaseMediaInfoHooks.php M extensions/MediaInfo/tests/phpunit/composer/DataModel/MediaInfoIdTest.php M extensions/MediaInfo/tests/phpunit/composer/DataModel/Serialization/MediaInfoSerializerTest.php M extensions/MediaInfo/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php M extensions/MediaInfo/tests/phpunit/mediawiki/View/MediaInfoViewTest.php M extensions/MediaInfo/tests/phpunit/mediawiki/WikibaseMediaInfoHooksTest.php M extensions/Wikibase/client/i18n/lij.json M extensions/Wikibase/client/i18n/nn.json M extensions/Wikibase/client/i18n/wuu.json M extensions/Wikibase/lib/i18n/ko.json M extensions/Wikibase/lib/i18n/nn.json M extensions/Wikibase/lib/includes/Store/EntityStore.php M extensions/Wikibase/lib/includes/Store/WikiPagePropertyOrderProvider.php M extensions/Wikibase/lib/tests/phpunit/MockRepository.php M extensions/Wikibase/repo/Wikibase.hooks.php M extensions/Wikibase/repo/i18n/af.json M extensions/Wikibase/repo/i18n/ar.json M extensions/Wikibase/repo/i18n/ast.json M extensions/Wikibase/repo/i18n/be-tarask.json M extensions/Wikibase/repo/i18n/bn.json M extensions/Wikibase/repo/i18n/ca.json M extensions/Wikibase/repo/i18n/ce.json M extensions/Wikibase/repo/i18n/ckb.json M extensions/Wikibase/repo/i18n/cs.json M extensions/Wikibase/repo/i18n/da.json M extensions/Wikibase/repo/i18n/de.json M extensions/Wikibase/repo/i18n/dsb.json M extensions/Wikibase/repo/i18n/el.json M extensions/Wikibase/repo/i18n/en.json M extensions/Wikibase/repo/i18n/es.json M extensions/Wikibase/repo/i18n/et.json M extensions/Wikibase/repo/i18n/fa.json M extensions/Wikibase/repo/i18n/fi.json M extensions/Wikibase/repo/i18n/fr.json M extensions/Wikibase/repo/i18n/gl.json M extensions/Wikibase/repo/i18n/hak.json M extensions/Wikibase/repo/i18n/he.json M extensions/Wikibase/repo/i18n/hsb.json M extensions/Wikibase/repo/i18n/hu.json M extensions/Wikibase/repo/i18n/id.json M extensions/Wikibase/repo/i18n/ilo.json M extensions/Wikibase/repo/i18n/is.json M extensions/Wikibase/repo/i18n/it.json M extensions/Wikibase/repo/i18n/ja.json M extensions/Wikibase/repo/i18n/ka.json M extensions/Wikibase/repo/i18n/ko.json M extensions/Wikibase/repo/i18n/lb.json M extensions/Wikibase/repo/i18n/lki.json M extensions/Wikibase/repo/i18n/lt.json M extensions/Wikibase/repo/i18n/min.json M extensions/Wikibase/repo/i18n/mk.json M extensions/Wikibase/repo/i18n/ms.json M extensions/Wikibase/repo/i18n/nap.json M extensions/Wikibase/repo/i18n/nb.json M extensions/Wikibase/repo/i18n/nl.json M extensions/Wikibase/repo/i18n/nn.json M extensions/Wikibase/repo/i18n/or.json M extensions/Wikibase/repo/i18n/pl.json M extensions/Wikibase/repo/i18n/pms.json M extensions/Wikibase/repo/i18n/pt-br.json M extensions/Wikibase/repo/i18n/pt.json M extensions/Wikibase/repo/i18n/qqq.json M extensions/Wikibase/repo/i18n/ro.json M extensions/Wikibase/repo/i18n/ru.json M extensions/Wikibase/repo/i18n/scn.json M extensions/Wikibase/repo/i18n/sgs.json M extensions/Wikibase/repo/i18n/sh.json M extensions/Wikibase/repo/i18n/sr-ec.json M extensions/Wikibase/repo/i18n/sr-el.json M extensions/Wikibase/repo/i18n/sv.json M extensions/Wikibase/repo/i18n/tg-cyrl.json M extensions/Wikibase/repo/i18n/tr.json M extensions/Wikibase/repo/i18n/uk.json M extensions/Wikibase/repo/i18n/vec.json M extensions/Wikibase/repo/i18n/vi.json M extensions/Wikibase/repo/i18n/yi.json M extensions/Wikibase/repo/i18n/zh-hans.json M extensions/Wikibase/repo/i18n/zh-hant.json M extensions/Wikibase/repo/includes/Api/EditEntity.php M extensions/Wikibase/repo/includes/Api/ModifyEntity.php M extensions/Wikibase/repo/includes/Content/EntityHandler.php M extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php M extensions/Wikibase/repo/includes/WikibaseRepo.php M extensions/Wikibase/repo/tests/ph
[MediaWiki-commits] [Gerrit] Prevent undeleting entities from ending with an exception - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/300749 Change subject: Prevent undeleting entities from ending with an exception .. Prevent undeleting entities from ending with an exception Bug: T140533 Change-Id: I4b256879e212dce01efd1def662cab8dcb97b4e7 (cherry picked from commit a5b635a9603b4649a2e4e8f66d3f6e54c8a6c189) --- M repo/Wikibase.hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/49/300749/1 diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php index 576be14..a9a9690 100644 --- a/repo/Wikibase.hooks.php +++ b/repo/Wikibase.hooks.php @@ -458,7 +458,7 @@ : $skinTemplate->getRevisionId(); $rev = Revision::newFromId( $revid ); - if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) { + if ( !$rev || $rev->isDeleted( Revision::DELETED_TEXT ) ) { return; } -- To view, visit https://gerrit.wikimedia.org/r/300749 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b256879e212dce01efd1def662cab8dcb97b4e7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: wmf/1.28.0-wmf.9 Gerrit-Owner: Aude Gerrit-Reviewer: Matěj Suchánek ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix entityselector font-size - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/300748 Change subject: Fix entityselector font-size .. Fix entityselector font-size Change-Id: I259b7467ce17a4b231012d3a9bad133db544e4cc (cherry picked from commit c724978b90b2ca4ae727eac0d3094555f4c6cdfe) --- M view/resources/jquery/wikibase/themes/default/jquery.wikibase.entityselector.css 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/48/300748/1 diff --git a/view/resources/jquery/wikibase/themes/default/jquery.wikibase.entityselector.css b/view/resources/jquery/wikibase/themes/default/jquery.wikibase.entityselector.css index d158a4e..bcdf053 100644 --- a/view/resources/jquery/wikibase/themes/default/jquery.wikibase.entityselector.css +++ b/view/resources/jquery/wikibase/themes/default/jquery.wikibase.entityselector.css @@ -8,6 +8,7 @@ padding: 0; position: absolute; z-index: 4; /* needed for MonoBook, #p-search is at 3 */ + font-size: 0.8em; } .ui-entityselector-list li, -- To view, visit https://gerrit.wikimedia.org/r/300748 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I259b7467ce17a4b231012d3a9bad133db544e4cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: wmf/1.28.0-wmf.9 Gerrit-Owner: Aude Gerrit-Reviewer: Jonas Kress (WMDE) ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ensure document slices which consist of content nodes get wr... - change (VisualEditor/VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Ensure document slices which consist of content nodes get wrapped .. Ensure document slices which consist of content nodes get wrapped We make sure document slices are balanced, but we also need to make sure that every document contains at least one branch node. Change-Id: I7272613e48a998c1787bcfefb2fca47869f07b60 --- M src/dm/ve.dm.Document.js M tests/dm/ve.dm.Document.test.js 2 files changed, 53 insertions(+), 24 deletions(-) Approvals: Divec: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/ve.dm.Document.js b/src/dm/ve.dm.Document.js index 6507a13..0e7201f 100644 --- a/src/dm/ve.dm.Document.js +++ b/src/dm/ve.dm.Document.js @@ -454,7 +454,7 @@ ve.dm.Document.prototype.shallowCloneFromRange = function ( range ) { var i, first, last, firstNode, lastNode, linearData, slice, originalRange, balancedRange, - balancedNodes, needsContext, + balancedNodes, needsContext, contextElement, startNode = this.getBranchNodeFromOffset( range.start ), endNode = this.getBranchNodeFromOffset( range.end ), selection = this.selectNodes( range, 'siblings' ), @@ -477,8 +477,11 @@ if ( selection.length === 0 ) { // Nothing selected - linearData = new ve.dm.ElementLinearData( this.getStore(), [] ); - originalRange = balancedRange = new ve.Range( 0 ); + linearData = new ve.dm.ElementLinearData( this.getStore(), [ + { type: 'paragraph', internal: { generated: 'empty' } }, + { type: 'paragraph' } + ] ); + originalRange = balancedRange = new ve.Range( 1 ); } else if ( startNode === endNode ) { // Nothing to balance balancedNodes = selection; @@ -527,11 +530,15 @@ ); } + function nodeNeedsContext( node ) { + return node.getParentNodeTypes() !== null || node.isContent(); + } + if ( !balancedRange ) { // Check if any of the balanced siblings need more context for insertion anywhere needsContext = false; for ( i = balancedNodes.length - 1; i >= 0; i-- ) { - if ( balancedNodes[ i ].node.getParentNodeTypes() !== null ) { + if ( nodeNeedsContext( balancedNodes[ i ].node ) ) { needsContext = true; break; } @@ -540,10 +547,11 @@ if ( needsContext ) { startNode = balancedNodes[ 0 ].node; // Keep wrapping until the outer node can be inserted anywhere - while ( startNode.getParent() && startNode.getParentNodeTypes() !== null ) { + while ( startNode.getParent() && nodeNeedsContext( startNode ) ) { startNode = startNode.getParent(); - contextOpenings.push( startNode.getClonedElement() ); - contextClosings.push( { type: '/' + startNode.getType() } ); + contextElement = startNode.getClonedElement(); + contextOpenings.push( contextElement ); + contextClosings.push( { type: '/' + contextElement.type } ); } } diff --git a/tests/dm/ve.dm.Document.test.js b/tests/dm/ve.dm.Document.test.js index cf3cc37..e2d0f1a 100644 --- a/tests/dm/ve.dm.Document.test.js +++ b/tests/dm/ve.dm.Document.test.js @@ -633,22 +633,35 @@ { msg: 'empty range', range: new ve.Range( 2 ), - expected: [] + expected: [ + { type: 'paragraph', internal: { generated: 'empty' } }, + { type: 'paragraph' } + ], + originalRange: new ve.Range( 1 ), + balancedRange: new ve.Range( 1 ) }, { msg: 'range with one character', range: new ve.Range( 2, 3 ), expected: [ - [ 'b', [ ve.dm.example.bold ] ] - ] + { type: 'heading', attributes: { level: 1 } }, + [ 'b', [ ve.dm.example.bold ] ], + { type: '/heading' } + ], +
[MediaWiki-commits] [Gerrit] Use more specific data model version in deployment branch - change (mediawiki...Wikibase)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/300750 Change subject: Use more specific data model version in deployment branch .. Use more specific data model version in deployment branch Use ~6.0.1 of wikibase/data-model. It's better not to pull in a new version of data model during backports, and there is breaking change that causes jenkins to fail. https://gerrit.wikimedia.org/r/#/c/299517/ fixes the jenkins failure, btw. Change-Id: I0eb9d7e8d9388bb8911e6d69c956145bd11dde29 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/50/300750/1 diff --git a/composer.json b/composer.json index f6d63e1..101e62d 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "data-values/serialization": "~1.1", "data-values/javascript": "~0.8.0", "data-values/value-view": "~0.17.1", - "wikibase/data-model": "~6.0", + "wikibase/data-model": "~6.0.1", "wikibase/data-model-serialization": "~2.2", "wikibase/internal-serialization": "~2.3", "wikibase/data-model-services": "~3.5", -- To view, visit https://gerrit.wikimedia.org/r/300750 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0eb9d7e8d9388bb8911e6d69c956145bd11dde29 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: wmf/1.28.0-wmf.9 Gerrit-Owner: Aude ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [lockdownSearchableNamespaces] Quickfix for empty $wgUser - change (mediawiki...Lockdown)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/300751 Change subject: [lockdownSearchableNamespaces] Quickfix for empty $wgUser .. [lockdownSearchableNamespaces] Quickfix for empty $wgUser Patch-Set #2: Changed $wgUser to $user Change-Id: I1bd8b62c31da8da7cd3779bfedc50e6a31cd3ec0 (cherry picked from commit 0d59ae7a7e0e3eb5a4638ba8f814a57926dada42) --- M Lockdown.php 1 file changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lockdown refs/changes/51/300751/1 diff --git a/Lockdown.php b/Lockdown.php index 2660a71..3502028 100644 --- a/Lockdown.php +++ b/Lockdown.php @@ -161,14 +161,20 @@ } function lockdownSearchableNamespaces($arr) { - global $wgUser, $wgNamespacePermissionLockdown; + global $wgNamespacePermissionLockdown; - //don't continue if $wgUser's name and id are both null (bug 28842) - if ( $wgUser->getId() === null && $wgUser->getName() === null ) { + $user = RequestContext::getMain()->getUser(); + + if ( !$user ) { return true; } - $ugroups = $wgUser->getEffectiveGroups( true );; + //don't continue if $user's name and id are both null (bug 28842) + if ( $user->getId() === null && $user->getName() === null ) { + return true; + } + + $ugroups = $user->getEffectiveGroups( true );; foreach ( $arr as $ns => $name ) { $groups = @$wgNamespacePermissionLockdown[$ns]['read']; -- To view, visit https://gerrit.wikimedia.org/r/300751 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bd8b62c31da8da7cd3779bfedc50e6a31cd3ec0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Lockdown Gerrit-Branch: REL1_27 Gerrit-Owner: Reedy Gerrit-Reviewer: Bhofmann ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add svn, git and ssh schemes - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Add svn, git and ssh schemes .. Add svn, git and ssh schemes The URL of a source code repository https://www.wikidata.org/wiki/Property:P1324 does not always use http[s] and sometime require a specific protocol: * SVN https://www.wikidata.org/wiki/Q46794 * git https://www.wikidata.org/wiki/Q186055 * ssh https://www.wikidata.org/wiki/Q170460 Bug: T140986 Change-Id: I2ab56205bdee84d0c8421f15f6509b493481debd --- M repo/config/Wikibase.default.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aude: Looks good to me, approved Daniel Kinzler: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php index df2305b..dbf0f0d 100644 --- a/repo/config/Wikibase.default.php +++ b/repo/config/Wikibase.default.php @@ -33,7 +33,7 @@ ], // URL schemes allowed for URL values. See UrlSchemeValidators for a full list. - 'urlSchemes' => [ 'ftp', 'http', 'https', 'irc', 'mailto' ], + 'urlSchemes' => [ 'ftp', 'http', 'https', 'irc', 'mailto', 'svn', 'git', 'ssh' ], // Items allowed to be used as badges pointing to their CSS class names 'badgeItems' => [], -- To view, visit https://gerrit.wikimedia.org/r/300342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ab56205bdee84d0c8421f15f6509b493481debd Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Dachary Gerrit-Reviewer: Aude Gerrit-Reviewer: Dachary Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Hoo man Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [lockdownSearchableNamespaces] Quickfix for empty $wgUser - change (mediawiki...Lockdown)
jenkins-bot has submitted this change and it was merged. Change subject: [lockdownSearchableNamespaces] Quickfix for empty $wgUser .. [lockdownSearchableNamespaces] Quickfix for empty $wgUser Patch-Set #2: Changed $wgUser to $user Change-Id: I1bd8b62c31da8da7cd3779bfedc50e6a31cd3ec0 (cherry picked from commit 0d59ae7a7e0e3eb5a4638ba8f814a57926dada42) --- M Lockdown.php 1 file changed, 10 insertions(+), 4 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/Lockdown.php b/Lockdown.php index 2660a71..3502028 100644 --- a/Lockdown.php +++ b/Lockdown.php @@ -161,14 +161,20 @@ } function lockdownSearchableNamespaces($arr) { - global $wgUser, $wgNamespacePermissionLockdown; + global $wgNamespacePermissionLockdown; - //don't continue if $wgUser's name and id are both null (bug 28842) - if ( $wgUser->getId() === null && $wgUser->getName() === null ) { + $user = RequestContext::getMain()->getUser(); + + if ( !$user ) { return true; } - $ugroups = $wgUser->getEffectiveGroups( true );; + //don't continue if $user's name and id are both null (bug 28842) + if ( $user->getId() === null && $user->getName() === null ) { + return true; + } + + $ugroups = $user->getEffectiveGroups( true );; foreach ( $arr as $ns => $name ) { $groups = @$wgNamespacePermissionLockdown[$ns]['read']; -- To view, visit https://gerrit.wikimedia.org/r/300751 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bd8b62c31da8da7cd3779bfedc50e6a31cd3ec0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Lockdown Gerrit-Branch: REL1_27 Gerrit-Owner: Reedy Gerrit-Reviewer: Bhofmann Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] registration: Support config setings that are relative paths - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: registration: Support config setings that are relative paths .. registration: Support config setings that are relative paths Add support for configuration settings that are relative paths to the extension directory. The most common use-case for this is where the extension ships a generic default file, but sysadmins or packagers may want to override it. Setting `"path": true` on the config definition will make the value be interpreted as a relative path. And add tests! Bug: T100956 Change-Id: Ia87ced25b35be7a314ee2937e0ccc63f9acc5bb5 --- M docs/extension.schema.json M includes/registration/ExtensionProcessor.php M tests/phpunit/includes/registration/ExtensionProcessorTest.php 3 files changed, 44 insertions(+), 5 deletions(-) Approvals: Reedy: Looks good to me, approved Daniel Kinzler: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/docs/extension.schema.json b/docs/extension.schema.json index 14a9731..9c8160d 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -881,6 +881,11 @@ ], "default": "array_merge" }, + "path": { + "description": "Whether this should be interpreted as a filesystem path, relative to extension directory root", + "type": "boolean", + "default": false + }, "description": { "type": ["string", "array"], "description": "A description of the config setting, mostly for documentation/developers" diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 0bf2842..9563fc0 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -162,14 +162,14 @@ * @return array */ public function extractInfo( $path, array $info, $version ) { + $dir = dirname( $path ); if ( $version === 2 ) { - $this->extractConfig2( $info ); + $this->extractConfig2( $info, $dir ); } else { // $version === 1 $this->extractConfig1( $info ); } $this->extractHooks( $info ); - $dir = dirname( $path ); $this->extractExtensionMessagesFiles( $dir, $info ); $this->extractMessagesDirs( $dir, $info ); $this->extractNamespaces( $info ); @@ -381,8 +381,9 @@ * @todo In the future, this should be done via Config interfaces * * @param array $info +* @param string $dir */ - protected function extractConfig2( array $info ) { + protected function extractConfig2( array $info, $dir ) { if ( isset( $info['config_prefix'] ) ) { $prefix = $info['config_prefix']; } else { @@ -394,6 +395,9 @@ if ( isset( $value['merge_strategy'] ) ) { $value[ExtensionRegistry::MERGE_STRATEGY] = $data['merge_strategy']; } + if ( isset( $data['path'] ) && $data['path'] ) { + $value = "$dir/$value"; + } $this->globals["$prefix$key"] = $value; } } diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php index be7fe91..11995de 100644 --- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php @@ -2,11 +2,12 @@ class ExtensionProcessorTest extends MediaWikiTestCase { - private $dir; + private $dir, $dirname; public function setUp() { parent::setUp(); $this->dir = __DIR__ . '/FooBar/extension.json'; + $this->dirname = dirname( $this->dir ); } /** @@ -110,7 +111,7 @@ /** * @covers ExtensionProcessor::extractConfig1 */ - public function testExtractConfig() { + public function testExtractConfig1() { $processor = new ExtensionProcessor; $info = [
[MediaWiki-commits] [Gerrit] Convert TrustedXFF to use extension registration - change (mediawiki...TrustedXFF)
jenkins-bot has submitted this change and it was merged. Change subject: Convert TrustedXFF to use extension registration .. Convert TrustedXFF to use extension registration Bug: T88065 Change-Id: I387db114990c62d8eaeb709d8ee870ed79053f8f --- D TrustedXFF.i18n.php M TrustedXFF.php A extension.json 3 files changed, 43 insertions(+), 68 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/TrustedXFF.i18n.php b/TrustedXFF.i18n.php deleted file mode 100644 index eeb2776..000 --- a/TrustedXFF.i18n.php +++ /dev/null @@ -1,31 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = __DIR__ . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; -}; diff --git a/TrustedXFF.php b/TrustedXFF.php index d85de9d..9fc486f 100644 --- a/TrustedXFF.php +++ b/TrustedXFF.php @@ -1,38 +1,14 @@ https://noc.wikimedia.org/conf/trusted-xff.cdb - * - * For details, see https://meta.wikimedia.org/wiki/XFF_project - */ -$wgTrustedXffFile = $IP . '/cache/trusted-xff.cdb'; - -// Register extension -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'TrustedXFF', - 'descriptionmsg' => 'trustedxff-desc', - 'author' => 'Tim Starling', - 'url'=> 'https://www.mediawiki.org/wiki/Extension:TrustedXFF', - 'license-name' => 'GPL-2.0+' -); - -// Load class -$wgAutoloadClasses['TrustedXFF'] = __DIR__ . '/TrustedXFF.body.php'; - -// I18n files -$wgMessagesDirs['TrustedXFF'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['TrustedXFF'] = __DIR__ . '/TrustedXFF.i18n.php'; - -// Load hook -$wgHooks['IsTrustedProxy'][] = 'TrustedXFF::onIsTrustedProxy'; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'TrustedXFF' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['TrustedXFF'] = __DIR__ . '/i18n'; + /*wfWarn( + 'Deprecated PHP entry point used for TrustedXFF extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + );*/ + return; +} else { + die( 'This version of the TrustedXFF extension requires MediaWiki 1.25+' ); +} \ No newline at end of file diff --git a/extension.json b/extension.json new file mode 100644 index 000..c5a27f0 --- /dev/null +++ b/extension.json @@ -0,0 +1,30 @@ +{ + "name": "TrustedXFF", + "license-name": "GPL-2.0+", + "url": "https://www.mediawiki.org/wiki/Extension:TrustedXFF";, + "descriptionmsg": "trustedxff-desc", + "author": [ + "Tim Starling" + ], + "type": "other", + "config": { + "TrustedXffFile": { + "value": "cache/trusted-xff.cdb", + "path": true + } + }, + "AutoloadClasses": { + "TrustedXFF": "TrustedXFF.body.php" + }, + "MessageDirs": { + "TrustedXFF": [ + "i18n" + ] + }, + "Hooks": { + "IsTrustedProxy": [ + "TrustedXFF::onIsTrustedProxy" + ] + }, + "manifest_version": 2 +} -- To view, visit https://gerrit.wikimedia.org/r/300550 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I387db114990c62d8eaeb709d8ee870ed79053f8f Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/TrustedXFF Gerrit-Branch: master Gerrit-Owner: MtDu Gerrit-Reviewe
[MediaWiki-commits] [Gerrit] Add version to TrustedXFF - change (mediawiki...TrustedXFF)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/300752 Change subject: Add version to TrustedXFF .. Add version to TrustedXFF Bump die text in php entry point to say 1.28 due to manifest version 2 Change-Id: If97956c6eb0610744bdc597276055429d1b47f12 --- M TrustedXFF.php M extension.json 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TrustedXFF refs/changes/52/300752/1 diff --git a/TrustedXFF.php b/TrustedXFF.php index 9fc486f..1d4cf30 100644 --- a/TrustedXFF.php +++ b/TrustedXFF.php @@ -10,5 +10,5 @@ );*/ return; } else { - die( 'This version of the TrustedXFF extension requires MediaWiki 1.25+' ); -} \ No newline at end of file + die( 'This version of the TrustedXFF extension requires MediaWiki 1.28+' ); +} diff --git a/extension.json b/extension.json index c5a27f0..498509f 100644 --- a/extension.json +++ b/extension.json @@ -3,6 +3,7 @@ "license-name": "GPL-2.0+", "url": "https://www.mediawiki.org/wiki/Extension:TrustedXFF";, "descriptionmsg": "trustedxff-desc", + "version": "1.1.0", "author": [ "Tim Starling" ], -- To view, visit https://gerrit.wikimedia.org/r/300752 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If97956c6eb0610744bdc597276055429d1b47f12 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TrustedXFF Gerrit-Branch: master Gerrit-Owner: Reedy ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add version to TrustedXFF - change (mediawiki...TrustedXFF)
jenkins-bot has submitted this change and it was merged. Change subject: Add version to TrustedXFF .. Add version to TrustedXFF Bump die text in php entry point to say 1.28 due to manifest version 2 Change-Id: If97956c6eb0610744bdc597276055429d1b47f12 --- M TrustedXFF.php M extension.json 2 files changed, 3 insertions(+), 2 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/TrustedXFF.php b/TrustedXFF.php index 9fc486f..1d4cf30 100644 --- a/TrustedXFF.php +++ b/TrustedXFF.php @@ -10,5 +10,5 @@ );*/ return; } else { - die( 'This version of the TrustedXFF extension requires MediaWiki 1.25+' ); -} \ No newline at end of file + die( 'This version of the TrustedXFF extension requires MediaWiki 1.28+' ); +} diff --git a/extension.json b/extension.json index c5a27f0..498509f 100644 --- a/extension.json +++ b/extension.json @@ -3,6 +3,7 @@ "license-name": "GPL-2.0+", "url": "https://www.mediawiki.org/wiki/Extension:TrustedXFF";, "descriptionmsg": "trustedxff-desc", + "version": "1.1.0", "author": [ "Tim Starling" ], -- To view, visit https://gerrit.wikimedia.org/r/300752 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If97956c6eb0610744bdc597276055429d1b47f12 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TrustedXFF Gerrit-Branch: master Gerrit-Owner: Reedy Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Convert to extension registration - change (mediawiki...TorBlock)
jenkins-bot has submitted this change and it was merged. Change subject: Convert to extension registration .. Convert to extension registration Bug: T87984 Change-Id: I12303c00445fc761b467371ace2646982d9a61e5 --- M TorBlock.php A extension.json M includes/TorBlockHooks.php 3 files changed, 113 insertions(+), 122 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/TorBlock.php b/TorBlock.php index 7811687..707ef2c 100644 --- a/TorBlock.php +++ b/TorBlock.php @@ -1,125 +1,15 @@ http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup Extensions - * @link http://www.mediawiki.org/wiki/Extension:TorBlock Documentation - * - * @author Andrew Garrett - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later - */ - -if ( !defined( 'MEDIAWIKI' ) ) { - die(); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'TorBlock' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['TorBlock'] = __DIR__ . '/i18n'; + /* wfWarn( + 'Deprecated PHP entry point used for TorBlock extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); */ + return; +} else { + die( 'This version of the TorBlock extension requires MediaWiki 1.28+' ); } - -$wgExtensionCredits['antispam'][] = array( - 'path' => __FILE__, - 'name' => 'TorBlock', - 'author' => 'Andrew Garrett', - 'descriptionmsg' => 'torblock-desc', - 'url'=> 'https://www.mediawiki.org/wiki/Extension:TorBlock', - 'license-name' => 'GPL-2.0+', -); - -$wgMessagesDirs['TorBlock'] = __DIR__ . '/i18n'; -$wgAutoloadClasses['TorBlockHooks'] = __DIR__ . '/includes/TorBlockHooks.php'; -$wgAutoloadClasses['TorExitNodes'] = __DIR__ . '/includes/TorExitNodes.php'; - -$wgHooks['getUserPermissionsErrorsExpensive'][] = 'TorBlockHooks::onGetUserPermissionsErrorsExpensive'; -$wgHooks['AbortAutoblock'][] = 'TorBlockHooks::onAbortAutoblock'; -$wgHooks['GetAutoPromoteGroups'][] = 'TorBlockHooks::onGetAutoPromoteGroups'; -$wgHooks['GetBlockedStatus'][] = 'TorBlockHooks::onGetBlockedStatus'; -$wgHooks['AutopromoteCondition'][] = 'TorBlockHooks::onAutopromoteCondition'; -$wgHooks['RecentChange_save'][] = 'TorBlockHooks::onRecentChangeSave'; -$wgHooks['ListDefinedTags'][] = 'TorBlockHooks::onListDefinedTags'; -$wgHooks['ChangeTagsListActive'][] = 'TorBlockHooks::onListDefinedTags'; -$wgHooks['AbuseFilter-filterAction'][] = 'TorBlockHooks::onAbuseFilterFilterAction'; -$wgHooks['AbuseFilter-builder'][] = 'TorBlockHooks::onAbuseFilterBuilder'; -$wgHooks['EmailUserPermissionsErrors'][] = 'TorBlockHooks::onEmailUserPermissionsErrors'; -$wgHooks['OtherBlockLogLink'][] = 'TorBlockHooks::onOtherBlockLogLink'; - -// Define new autopromote condition -define( 'APCOND_TOR', 'tor' ); // Numbers won't work, we'll get collisions - -/** - * Permission keys that bypass Tor blocks. - * Array of permission keys. - */ -$wgTorBypassPermissions = array( 'torunblocked', /*'autoconfirmed'*/ ); -$wgAvailableRights[] = 'torunblocked'; -$wgGrantPermissions['basic']['torunblocked'] = true; -$wgGroupPermissions['user']['torunblocked'] = true; - -/** - * Whether to load Tor blocks if they aren't stored in memcached. - * Set to false on high-load sites, and use a cron job with the included - * maintenance script - */ -$wgTorLoadNodes = true; - -/** - * Actions tor users are allowed to do. - * E.g. to allow account creation, add createaccount. - */ -$wgTorAllowedActions = array( 'read' ); - -/** - * Autoconfirm limits for tor users. - * Both regular limits, AND Tor limits must be passed. - */ -$wgTorAutoConfirmAge = 0; -$wgTorAutoConfirmCount = 0; - -/** - * IPs to check for tor exits to. - * (i.e. all IPs which can be used to access the site. - */ -$wgTorIPs = array( '208.80.152.2' ); - -/** - * Onionoo server to use to poll information from for exit nodes. - */ -$wgTorOnionooServer = 'https://onionoo.torproject.org'; - -/** - * Path to the CA file for the Onionoo server. - * Set to false or any other invalid value to disable. - */ -$wgTorOnionooCA = __DIR__ . "/torproject.crt"; - -/** - * Path to the CA file for the Tor Project. - * Set to false or any other invalid value to disable. - */ -$wgTorProjectCA = __DIR__ . "/torproject.crt"; - -/** - * Disable existing blocks of Tor nodes - */ -$wgTorDisableAdminBlocks = true; - -/** Mark tor edits as such */ -$wgTorTagChanges = true; - -/** - * Proxy to use, if not the default proxy - */ -$wgTorBlockProxy = false; diff --git a/extension.json b/extension.json new file mode 100644 index 000..3ee59e9 --- /dev/null +++ b/extension.json @@ -0,0 +1,95 @@ +{ + "name": "TorBlock", + "author": "Andrew Garrett", + "url"
[MediaWiki-commits] [Gerrit] Remove mediawiki/mediawiki from require - change (mediawiki...Collection)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/300753 Change subject: Remove mediawiki/mediawiki from require .. Remove mediawiki/mediawiki from require Bug: T141221 Change-Id: I3051b6ec124de4c680c08abd75b836121b33fba6 --- M composer.json 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/53/300753/1 diff --git a/composer.json b/composer.json index 573c5e4..8c50dab 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,6 @@ "require": { "composer/installers" : ">=1.0.1", - "mediawiki/mediawiki" : ">=1.25" }, "config": { "prepend-autoloader": false, -- To view, visit https://gerrit.wikimedia.org/r/300753 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3051b6ec124de4c680c08abd75b836121b33fba6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: Reedy ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update justinrainbow/json-schema in require-dev to ~1.6 - change (mediawiki/core)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/300754 Change subject: Update justinrainbow/json-schema in require-dev to ~1.6 .. Update justinrainbow/json-schema in require-dev to ~1.6 This matches the version that Kartographer is tracking, and hence the committed vendor repo Change-Id: I92bc1d03e62482bf9de4903ac14f79a4340ed1f2 --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/300754/1 diff --git a/composer.json b/composer.json index 54eb3c0..1bd3d4c 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "justinrainbow/json-schema": "~1.3", + "justinrainbow/json-schema": "~1.6", "mediawiki/mediawiki-codesniffer": "0.7.2", "monolog/monolog": "~1.18.2", "nikic/php-parser": "1.4.1", -- To view, visit https://gerrit.wikimedia.org/r/300754 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92bc1d03e62482bf9de4903ac14f79a4340ed1f2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Reedy ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Promote justinrainbow/json-schema from dev to always required - change (mediawiki/core)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/300755 Change subject: Promote justinrainbow/json-schema from dev to always required .. Promote justinrainbow/json-schema from dev to always required Bug: T140908 Change-Id: I7782a904970e0084171691b2a06945f900fa38d0 --- M RELEASE-NOTES-1.28 M composer.json 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/300755/1 diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index a20bec0..3f37015 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -43,6 +43,7 @@ * Updated es5-shim from v4.1.5 to v4.5.8 New external libraries +* Added justinrainbow/json-schema v1.6 (promoted from dev dependency). Removed and replaced external libraries diff --git a/composer.json b/composer.json index 1bd3d4c..3c1d8eb 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,7 @@ "ext-json": "*", "ext-mbstring": "*", "ext-xml": "*", + "justinrainbow/json-schema": "~1.6", "liuggio/statsd-php-client": "1.0.18", "mediawiki/at-ease": "1.1.0", "oojs/oojs-ui": "0.17.6", @@ -45,7 +46,6 @@ }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "justinrainbow/json-schema": "~1.6", "mediawiki/mediawiki-codesniffer": "0.7.2", "monolog/monolog": "~1.18.2", "nikic/php-parser": "1.4.1", -- To view, visit https://gerrit.wikimedia.org/r/300755 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7782a904970e0084171691b2a06945f900fa38d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Reedy ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Some tweaks for compatibility with newer versions of MediaWi... - change (mediawiki...PdfExport)
Seb35 has uploaded a new change for review. https://gerrit.wikimedia.org/r/300756 Change subject: Some tweaks for compatibility with newer versions of MediaWiki, Dompdf, PHP .. Some tweaks for compatibility with newer versions of MediaWiki, Dompdf, PHP PHP compatibility: * changed the class constructor to __construct instead of the class name MediaWiki compatibility: * Article::preSaveTransform no longer exists (since MW 1.18) Dompdf compatibility: * class renamed from DOMPDF to Dompdf\Dompdf * added some installation instructions to use Composer * added autodetection when Dompdf is installed with Composer * removed utf8_decode, it works better without it Warning: I only tested with the Dompdf and HTMLDoc backends, possibly the others still don’t work; and in fact HTMLDoc currently doesn’t work, only Dompdf works. Issue related to this commit: https://www.mediawiki.org/wiki/Topic:T7n9rikdef7xg59c Change-Id: I04eda179bab689e29b9f26caf10807f4136afa3f --- M PdfExport_body.php M converters/DomPdfConverter.php M converters/HtmlDocPdfConverter.php M converters/MPdfConverter.php M converters/PdfConverterFactory.php M converters/PrincePdfConverter.php 6 files changed, 23 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PdfExport refs/changes/56/300756/1 diff --git a/PdfExport_body.php b/PdfExport_body.php index f53d28e..365c295 100755 --- a/PdfExport_body.php +++ b/PdfExport_body.php @@ -27,7 +27,7 @@ /** * Setup the special page. Tries to detect a PDF generation tool to use. Prefers in order: PrincePDF, HtmlDoc, DomPdf. */ - function SpecialPdf () { + function __construct() { parent::__construct('PdfPrint'); $this->converter = PdfConverterFactory::getPdfConverter(); } diff --git a/converters/DomPdfConverter.php b/converters/DomPdfConverter.php index c3b9119..34a8808 100755 --- a/converters/DomPdfConverter.php +++ b/converters/DomPdfConverter.php @@ -2,10 +2,16 @@ if (!defined('MEDIAWIKI')) die(); +use Dompdf\Dompdf; + /** * A DomPdf based conversion backend. * * Installation: + * DomPdf can be easily installed with Composer: add in the file composer.local.json (from MediaWiki 1.25): + * "dompdf/dompdf": "*" (and possibly a comma at the end of this line if it is not the last item) + * in the 'require' section, and run 'composer update --no-dev'. If you choose this installation way, you + * don’t need to set $wgPdfExportDomPdfConfigFile, it will be automatically detected. * DomPdf can be downloaded from here: http://code.google.com/p/dompdf/. Unzip the code into your * extension directory and set $wgPdfExportDomPdfConfigFile equal to the full path to the * dompdf_config.inc.php file. @@ -22,7 +28,9 @@ function initialize (&$options) { global $wgPdfExportDomPdfConfigFile; // Load the configuration file. This loads the whole DomPdf framework - require_once($wgPdfExportDomPdfConfigFile); + if( !class_exists( 'Dompdf\Dompdf' ) ) { + require_once($wgPdfExportDomPdfConfigFile); + } } /** @@ -87,7 +95,7 @@ global $wgOut, $IP, $wgPdfExportAttach; $wgOut->disable(); #$old_error_level = error_reporting( 0 ); - $dompdf = new DOMPDF(); + $dompdf = new Dompdf(); $dompdf->set_base_path("$IP/"); $dompdf->set_paper( strtolower( $options['size'] ), $options['orientation']); $dompdf->load_html($html); @@ -112,7 +120,7 @@ $dompdf->get_canvas()->get_cpdf()->setEncryption($options['user_pass'], $options['owner_pass'], $perms); } } - $dompdf->stream(utf8_decode($options['filename']) . ".pdf", array('Attachment'=>($wgPdfExportAttach?1:0))); + $dompdf->stream($options['filename'] . ".pdf", array('Attachment'=>($wgPdfExportAttach?1:0))); #error_reporting( $old_error_level ); } @@ -136,12 +144,9 @@ $parserOptions = ParserOptions::newFromUser( $wgUser ); $parserOptions->setEditSection( false ); $parserOptions->setTidy(true); - $parserOutput = $wgParser->parse( $article->preSaveTransform( "__NOTOC__\n\n".$article->getContent() ) ."\n\n", $title, $parserOptions ); + $parserOutput = $wgParser->parse( "__NOTOC__\n\n" . $article->getContent() . "\n\n", $title, $parserOptions ); $bhtml = $parserOutput->getText(); - // Hack to thread the EUR sign correctly - $bhtml = str_replace(chr(0xE2) . chr(0x82) . chr(0xAC), chr(0xA4), $bhtml); - $bhtml = utf8_decode($bhtml); // add the '"'.
[MediaWiki-commits] [Gerrit] Disabling local uploads on ms.wikipedia.org - change (operations/mediawiki-config)
MarcoAurelio has uploaded a new change for review. https://gerrit.wikimedia.org/r/300758 Change subject: Disabling local uploads on ms.wikipedia.org .. Disabling local uploads on ms.wikipedia.org Point local users to the commons' upload wizard instead, per community consensus. Bug: T141227 Change-Id: I61a09d711c9826ef9fd6480fda0ab6d30e92069e --- M dblists/commonsuploads.dblist M wmf-config/InitialiseSettings.php 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/58/300758/1 diff --git a/dblists/commonsuploads.dblist b/dblists/commonsuploads.dblist index becdb5f..6dbc46c 100644 --- a/dblists/commonsuploads.dblist +++ b/dblists/commonsuploads.dblist @@ -316,6 +316,7 @@ mrwikiquote mrwikisource mrwiktionary +mswiki mswikibooks mswiktionary mtwiki diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4ad73cb..fc37e8c 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -1217,6 +1217,7 @@ 'jawiktionary' => false, // T13775 'loginwiki' => false, 'lrcwiki' => false, // T102026 + 'mswiki' => false, // T141227 'mswiktionary' => false, // T69152 'nlwikisource' => false, // T73403 'nlwikivoyage' => false, // T73403 @@ -1307,6 +1308,7 @@ 'lrcwiki' => '//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=lrc', // T102026 'metawiki' => false, // T52287 'mlwiki' => '/wiki/വിക്കിപീഡിയ:അപ്ലോഡ്', + 'mswiki' => '//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=ms', // T141227 'ndswiki' => '//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=nds', 'nlwiki' => '//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=nl', 'nlwikisource' => '//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=nl', -- To view, visit https://gerrit.wikimedia.org/r/300758 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61a09d711c9826ef9fd6480fda0ab6d30e92069e Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarcoAurelio ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Convert wikimedia_sites to use requests - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Convert wikimedia_sites to use requests .. Convert wikimedia_sites to use requests Bug: T130524 Change-Id: I2a076683a7de84b3b3ad05947ba02383fc1b6d8c --- M scripts/maintenance/wikimedia_sites.py 1 file changed, 3 insertions(+), 7 deletions(-) Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py index 3c56c28..b0d235d 100755 --- a/scripts/maintenance/wikimedia_sites.py +++ b/scripts/maintenance/wikimedia_sites.py @@ -14,18 +14,14 @@ import codecs import re -import sys + +import requests from xml.etree import cElementTree import pywikibot from pywikibot.family import Family - -if sys.version_info[0] > 2: -from urllib.request import urlopen -else: -from urllib import urlopen URL = 'https://wikistats.wmflabs.org/api.php?action=dump&table=%s&format=xml' @@ -52,7 +48,7 @@ original = Family.load(family).languages_by_size obsolete = Family.load(family).obsolete -feed = urlopen(URL % familiesDict[family]) +feed = requests.get(URL % familiesDict[family]) tree = cElementTree.parse(feed) new = [] -- To view, visit https://gerrit.wikimedia.org/r/300747 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a076683a7de84b3b3ad05947ba02383fc1b6d8c Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: MtDu Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Merlijn van Deen Gerrit-Reviewer: Mpaa Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make onTransactionPreCommitOrIdle() atomic when immediate - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/300759 Change subject: Make onTransactionPreCommitOrIdle() atomic when immediate .. Make onTransactionPreCommitOrIdle() atomic when immediate One of the main uses of this method is to tack on some DB updates to the end of atomic transactions to reduce lock contention problems. In this case, multiple updates in the callback are atomic. However, if no transaction is active, then such updates were previously not atomic. Wrap them in transactions now. Change-Id: I18c56e65063a61000c4dfd1979bf972800b173ac --- M includes/db/Database.php M includes/db/IDatabase.php 2 files changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/59/300759/1 diff --git a/includes/db/Database.php b/includes/db/Database.php index 9b73584..91517b5 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2468,7 +2468,10 @@ if ( $this->mTrxLevel ) { $this->mTrxPreCommitCallbacks[] = [ $callback, wfGetCaller() ]; } else { - $this->onTransactionIdle( $callback ); // this will trigger immediately + // If no transaction is active, then make one for this callback + $this->begin( __METHOD__ ); + call_user_func( $callback ); + $this->commit( __METHOD__ ); } } diff --git a/includes/db/IDatabase.php b/includes/db/IDatabase.php index c024632..aa2a980 100644 --- a/includes/db/IDatabase.php +++ b/includes/db/IDatabase.php @@ -1221,7 +1221,7 @@ public function getMasterPos(); /** -* Run an anonymous function as soon as the current transaction commits or rolls back. +* Run a callback as soon as the current transaction commits or rolls back. * An error is thrown if no transaction is pending. Queries in the function will run in * AUTO-COMMIT mode unless there are begin() calls. Callbacks must commit any transactions * that they begin. @@ -1238,7 +1238,7 @@ public function onTransactionResolution( callable $callback ); /** -* Run an anonymous function as soon as there is no transaction pending. +* Run a callback as soon as there is no transaction pending. * If there is a transaction and it is rolled back, then the callback is cancelled. * Queries in the function will run in AUTO-COMMIT mode unless there are begin() calls. * Callbacks must commit any transactions that they begin. @@ -1259,9 +1259,10 @@ public function onTransactionIdle( callable $callback ); /** -* Run an anonymous function before the current transaction commits or now if there is none. +* Run a callback before the current transaction commits or now if there is none. * If there is a transaction and it is rolled back, then the callback is cancelled. -* Callbacks must not start nor commit any transactions. +* Callbacks must not start nor commit any transactions. If no transaction is active, +* then a transaction will wrap the callback. * * This is useful for updates that easily cause deadlocks if locks are held too long * but where atomicity is strongly desired for these updates and some related updates. -- To view, visit https://gerrit.wikimedia.org/r/300759 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18c56e65063a61000c4dfd1979bf972800b173ac Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add python (aka python3) images - change (operations...toollabs-images)
jenkins-bot has submitted this change and it was merged. Change subject: Add python (aka python3) images .. Add python (aka python3) images Change-Id: I85c089bf14ede5b862c140d058c4f81b74df6ee1 --- M build.py A python/base/.dockerignore A python/base/Dockerfile.template A python/web/.dockerignore A python/web/Dockerfile.template 5 files changed, 24 insertions(+), 0 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/build.py b/build.py index e11cd02..3cebbcc 100755 --- a/build.py +++ b/build.py @@ -33,6 +33,10 @@ 'python2/base': [ 'python2/web', ], +# Python refers to python3, because it is 2016! +'python/base': [ +'python/web', +] }, } diff --git a/python/base/.dockerignore b/python/base/.dockerignore new file mode 100644 index 000..689cf97 --- /dev/null +++ b/python/base/.dockerignore @@ -0,0 +1 @@ +Dockerfile.template diff --git a/python/base/Dockerfile.template b/python/base/Dockerfile.template new file mode 100644 index 000..39d3731 --- /dev/null +++ b/python/base/Dockerfile.template @@ -0,0 +1,9 @@ +# Toollabs Python3 runtime image +# Name: docker-registry.tools.wmflabs.org/toollabs-python +FROM {registry}/{image_prefix}-base + +RUN apt-get install --yes \ +python3 \ +python3-dev \ +build-essential \ +python3-virtualenv diff --git a/python/web/.dockerignore b/python/web/.dockerignore new file mode 100644 index 000..689cf97 --- /dev/null +++ b/python/web/.dockerignore @@ -0,0 +1 @@ +Dockerfile.template diff --git a/python/web/Dockerfile.template b/python/web/Dockerfile.template new file mode 100644 index 000..aec09ee --- /dev/null +++ b/python/web/Dockerfile.template @@ -0,0 +1,9 @@ +# Toollabs Python3 webserver image +# Name: docker-registry.tools.wmflabs.org/toollabs-python-web +FROM {registry}/{image_prefix}-python-base + +RUN apt-get install --yes \ +uwsgi \ +uwsgi-plugin-python3 + +RUN apt-get install --yes toollabs-webservice -- To view, visit https://gerrit.wikimedia.org/r/298557 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I85c089bf14ede5b862c140d058c4f81b74df6ee1 Gerrit-PatchSet: 2 Gerrit-Project: operations/docker-images/toollabs-images Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Yuvipanda Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor transaction callback cleanups - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Minor transaction callback cleanups .. Minor transaction callback cleanups * Give the flush commit() in close() a chance to handle callbacks. Also detect onTransactionResolution() callbacks when an error is thrown. * Avoid resetting callbacks redundantly, as they already get cleared when they actually run. * Fix a few doc comments. Change-Id: I5c62262661b97a6c28ce0ab0949307dc119953ca --- M includes/db/Database.php 1 file changed, 4 insertions(+), 7 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/Database.php b/includes/db/Database.php index 9b73584..bda4ccf 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -694,9 +694,6 @@ } public function close() { - if ( count( $this->mTrxIdleCallbacks ) ) { // sanity - throw new MWException( "Transaction idle callbacks still pending." ); - } if ( $this->mConn ) { if ( $this->trxLevel() ) { if ( !$this->mTrxAutomatic ) { @@ -709,6 +706,8 @@ $closed = $this->closeConnection(); $this->mConn = false; + } elseif ( $this->mTrxIdleCallbacks || $this->mTrxEndCallbacks ) { // sanity + throw new MWException( "Transaction callbacks still pending." ); } else { $closed = true; } @@ -2473,7 +2472,7 @@ } /** -* Actually any "on transaction idle" callbacks. +* Actually run and consume any "on transaction idle" callbacks. * * @param integer $trigger IDatabase::TRIGGER_* constant * @since 1.20 @@ -2519,7 +2518,7 @@ } /** -* Actually any "on transaction pre-commit" callbacks. +* Actually run and consume any "on transaction pre-commit" callbacks. * * This method should not be used outside of Database/LoadBalancer * @@ -2637,8 +2636,6 @@ $this->mTrxAutomatic = false; $this->mTrxAutomaticAtomic = false; $this->mTrxAtomicLevels = []; - $this->mTrxIdleCallbacks = []; - $this->mTrxPreCommitCallbacks = []; $this->mTrxShortId = wfRandomString( 12 ); $this->mTrxWriteDuration = 0.0; $this->mTrxWriteCallers = []; -- To view, visit https://gerrit.wikimedia.org/r/300684 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c62262661b97a6c28ce0ab0949307dc119953ca Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use === for comparisons - change (mediawiki...SecureHTML)
Fo0bar has uploaded a new change for review. https://gerrit.wikimedia.org/r/300760 Change subject: Use === for comparisons .. Use === for comparisons "$testhash == $computedhash" may allow for increased collision probability, due to PHP's loose type handling, so use ===. Thanks to Alyssa Milburn for discovering this. Change-Id: I612e7df65c925df31c9c71136791fa1e93a99783 --- M SecureHTML.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecureHTML refs/changes/60/300760/1 diff --git a/SecureHTML.php b/SecureHTML.php index 90f1fd1..1f39c21 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -82,7 +82,7 @@ } # If the array is empty, there is no possible way this will work. - if ( count( $wgSecureHTMLSecrets ) == 0 ) { + if ( count( $wgSecureHTMLSecrets ) === 0 ) { return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-nokeys' ) ) ); } @@ -117,7 +117,7 @@ $testhash = hash_hmac( $keyalgorithm, $input, $keysecret ); # If the test hash matches the supplied hash, return the raw HTML. Otherwise, error. - if ( $testhash == $argv['hash'] ) { + if ( $testhash === $argv['hash'] ) { return( array( $input, 'markerType' => 'nowiki' ) ); } else { return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); -- To view, visit https://gerrit.wikimedia.org/r/300760 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I612e7df65c925df31c9c71136791fa1e93a99783 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Provide additional protection against key name leaks - change (mediawiki...SecureHTML)
Fo0bar has uploaded a new change for review. https://gerrit.wikimedia.org/r/300761 Change subject: Provide additional protection against key name leaks .. Provide additional protection against key name leaks The existence of a key name could be discovered by a timing attack, giving a very large input and seeing if the "invalid hash" comes back quickly or not. Mitigate this by, upon invalid key name, performing a dummy HMAC SHA256 against the input before returning the error. Also, provide extra options in the form of $wgSecureHTMLSpecialDropdown (default True) for Special:SecureHTML. If set to False, the key name input field becomes a text field instead of a dropdown. Thanks to Alyssa Milburn for discovering the potential timing attack. Change-Id: Id46419aa4a3a5dd6bc7fe9f8d5df7555d29c169f --- M SecureHTML.php M SpecialSecureHTML.php 2 files changed, 27 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecureHTML refs/changes/61/300761/1 diff --git a/SecureHTML.php b/SecureHTML.php index 90f1fd1..f585974 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -49,6 +49,9 @@ if ( !isset( $wgSecureHTMLSpecialRight ) ) { $wgSecureHTMLSpecialRight = 'edit'; } +if ( !isset( $wgSecureHTMLSpecialDropdown ) ) { + $wgSecureHTMLSpecialDropdown = True; +} if ( !isset( $wgSecureHTMLTag ) ) { $wgSecureHTMLTag = 'shtml'; } @@ -95,9 +98,11 @@ # Key secret configuration. $keyalgorithm = 'sha256'; if ( !array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { - # Respond with "invalid hash" instead of something like "invalid - # key name", to avoid leaking the existence of a key name due to - # dictionary attack. + # To avoid leaking the existence of a key name by unauthorized users, + # perform a dummy HMAC SHA256 (mitigate timing attacks), then + # respond with "invalid hash", instead of something like "invalid key + # name". + $testhash = hash_hmac( 'sha256', $input, '' ); return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { diff --git a/SpecialSecureHTML.php b/SpecialSecureHTML.php index 8121725..1915b85 100644 --- a/SpecialSecureHTML.php +++ b/SpecialSecureHTML.php @@ -9,6 +9,7 @@ function execute( $par ) { global $wgSecureHTMLSecrets; global $wgSecureHTMLTag; + global $wgSecureHTMLSpecialDropdown; $request = $this->getRequest(); $output = $this->getOutput(); @@ -62,17 +63,25 @@ $output->addWikiText( wfMessage( 'securehtml-inputinstructions' ) ); $formDescriptor = array(); - $keyname_labels = array( - '' => '', - ); - foreach ( array_keys( $wgSecureHTMLSecrets ) as $skeyname ) { - $keyname_labels[$skeyname] = $skeyname; + + if ( $wgSecureHTMLSpecialDropdown ) { + $keyname_labels = array( + '' => '', + ); + foreach ( array_keys( $wgSecureHTMLSecrets ) as $skeyname ) { + $keyname_labels[$skeyname] = $skeyname; + } + $formDescriptor['securehtmlkeyname'] = array( + 'type' => 'select', + 'label-message' => 'securehtml-form-keyname', + 'options' => $keyname_labels, + ); + } else { + $formDescriptor['securehtmlkeyname'] = array( + 'type' => 'text', + 'label-message' => 'securehtml-form-keyname', + ); } - $formDescriptor['securehtmlkeyname'] = array( - 'type' => 'select', - 'label-message' => 'securehtml-form-keyname', - 'options' => $keyname_labels, - ); $formDescriptor['securehtmlkeysecret'] = array( 'type' => 'password', 'label-message' => 'securehtml-form-keysecret', -- To view, visit https://gerrit.wikimedia.org/r/300761 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id46419aa4a3a5dd6bc7fe9f8d5df7555d29c169f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.o
[MediaWiki-commits] [Gerrit] Use === for comparisons - change (mediawiki...SecureHTML)
Fo0bar has submitted this change and it was merged. Change subject: Use === for comparisons .. Use === for comparisons "$testhash == $computedhash" may allow for increased collision probability, due to PHP's loose type handling, so use ===. Thanks to Alyssa Milburn for discovering this. Change-Id: I612e7df65c925df31c9c71136791fa1e93a99783 --- M SecureHTML.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Fo0bar: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/SecureHTML.php b/SecureHTML.php index 90f1fd1..1f39c21 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -82,7 +82,7 @@ } # If the array is empty, there is no possible way this will work. - if ( count( $wgSecureHTMLSecrets ) == 0 ) { + if ( count( $wgSecureHTMLSecrets ) === 0 ) { return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-nokeys' ) ) ); } @@ -117,7 +117,7 @@ $testhash = hash_hmac( $keyalgorithm, $input, $keysecret ); # If the test hash matches the supplied hash, return the raw HTML. Otherwise, error. - if ( $testhash == $argv['hash'] ) { + if ( $testhash === $argv['hash'] ) { return( array( $input, 'markerType' => 'nowiki' ) ); } else { return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); -- To view, visit https://gerrit.wikimedia.org/r/300760 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I612e7df65c925df31c9c71136791fa1e93a99783 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar Gerrit-Reviewer: Fo0bar Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Provide additional protection against key name leaks - change (mediawiki...SecureHTML)
Fo0bar has submitted this change and it was merged. Change subject: Provide additional protection against key name leaks .. Provide additional protection against key name leaks The existence of a key name could be discovered by a timing attack, giving a very large input and seeing if the "invalid hash" comes back quickly or not. Mitigate this by, upon invalid key name, performing a dummy HMAC SHA256 against the input before returning the error. Also, provide extra options in the form of $wgSecureHTMLSpecialDropdown (default True) for Special:SecureHTML. If set to False, the key name input field becomes a text field instead of a dropdown. Thanks to Alyssa Milburn for discovering the potential timing attack. Change-Id: Id46419aa4a3a5dd6bc7fe9f8d5df7555d29c169f --- M SecureHTML.php M SpecialSecureHTML.php 2 files changed, 27 insertions(+), 13 deletions(-) Approvals: Fo0bar: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/SecureHTML.php b/SecureHTML.php index 90f1fd1..f585974 100644 --- a/SecureHTML.php +++ b/SecureHTML.php @@ -49,6 +49,9 @@ if ( !isset( $wgSecureHTMLSpecialRight ) ) { $wgSecureHTMLSpecialRight = 'edit'; } +if ( !isset( $wgSecureHTMLSpecialDropdown ) ) { + $wgSecureHTMLSpecialDropdown = True; +} if ( !isset( $wgSecureHTMLTag ) ) { $wgSecureHTMLTag = 'shtml'; } @@ -95,9 +98,11 @@ # Key secret configuration. $keyalgorithm = 'sha256'; if ( !array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { - # Respond with "invalid hash" instead of something like "invalid - # key name", to avoid leaking the existence of a key name due to - # dictionary attack. + # To avoid leaking the existence of a key name by unauthorized users, + # perform a dummy HMAC SHA256 (mitigate timing attacks), then + # respond with "invalid hash", instead of something like "invalid key + # name". + $testhash = hash_hmac( 'sha256', $input, '' ); return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); } if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { diff --git a/SpecialSecureHTML.php b/SpecialSecureHTML.php index 8121725..1915b85 100644 --- a/SpecialSecureHTML.php +++ b/SpecialSecureHTML.php @@ -9,6 +9,7 @@ function execute( $par ) { global $wgSecureHTMLSecrets; global $wgSecureHTMLTag; + global $wgSecureHTMLSpecialDropdown; $request = $this->getRequest(); $output = $this->getOutput(); @@ -62,17 +63,25 @@ $output->addWikiText( wfMessage( 'securehtml-inputinstructions' ) ); $formDescriptor = array(); - $keyname_labels = array( - '' => '', - ); - foreach ( array_keys( $wgSecureHTMLSecrets ) as $skeyname ) { - $keyname_labels[$skeyname] = $skeyname; + + if ( $wgSecureHTMLSpecialDropdown ) { + $keyname_labels = array( + '' => '', + ); + foreach ( array_keys( $wgSecureHTMLSecrets ) as $skeyname ) { + $keyname_labels[$skeyname] = $skeyname; + } + $formDescriptor['securehtmlkeyname'] = array( + 'type' => 'select', + 'label-message' => 'securehtml-form-keyname', + 'options' => $keyname_labels, + ); + } else { + $formDescriptor['securehtmlkeyname'] = array( + 'type' => 'text', + 'label-message' => 'securehtml-form-keyname', + ); } - $formDescriptor['securehtmlkeyname'] = array( - 'type' => 'select', - 'label-message' => 'securehtml-form-keyname', - 'options' => $keyname_labels, - ); $formDescriptor['securehtmlkeysecret'] = array( 'type' => 'password', 'label-message' => 'securehtml-form-keysecret', -- To view, visit https://gerrit.wikimedia.org/r/300761 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id46419aa4a3a5dd6bc7fe9f8d5df7555d29c169f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureHTML Gerrit-Branch: master Gerrit-Owner: Fo0bar Gerrit-Reviewer: Fo0bar Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.
[MediaWiki-commits] [Gerrit] Error checking - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/300766 Change subject: Error checking .. Error checking Change-Id: Ie55277d62fefeae0c6633dde311698ad98e017c7 --- M Core/DataStores/PendingDatabase.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/66/300766/1 diff --git a/Core/DataStores/PendingDatabase.php b/Core/DataStores/PendingDatabase.php index 1900541..c5671f2 100644 --- a/Core/DataStores/PendingDatabase.php +++ b/Core/DataStores/PendingDatabase.php @@ -178,6 +178,10 @@ * @param array $message */ public function deleteMessage( $message ) { + if ( !isset( $message['order_id'] ) ) { + throw new RuntimeException( 'Message doesn\'t have an order_id!' ); + } + $prepared = self::$db->prepare( ' delete from pending where gateway = :gateway -- To view, visit https://gerrit.wikimedia.org/r/300766 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie55277d62fefeae0c6633dde311698ad98e017c7 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] user page updates - change (wikimedia/TransparencyReport-private)
Siddparmar has uploaded a new change for review. https://gerrit.wikimedia.org/r/300775 Change subject: user page updates .. user page updates Change-Id: Icff763234b28599934e64f3f4f1dbfcc17184c5c --- M build/content.html M build/fr/content.html M build/fr/privacy.html M build/privacy.html M build/stylesheets/master.css M locales/en.yml M source/localizable/privacy.html.erb M source/stylesheets/master.css.scss 8 files changed, 357 insertions(+), 232 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/TransparencyReport-private refs/changes/75/300775/1 diff --git a/build/content.html b/build/content.html index 3f15807..1fd9bb5 100644 --- a/build/content.html +++ b/build/content.html @@ -139,7 +139,7 @@ Canada - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 @@ -154,12 +154,12 @@ Georgia - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 Turkey - Government Agency + Government agency 1 @@ -169,12 +169,12 @@ - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 United States - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 diff --git a/build/fr/content.html b/build/fr/content.html index 6c67947..0eb4d59 100644 --- a/build/fr/content.html +++ b/build/fr/content.html @@ -139,7 +139,7 @@ Canada - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 @@ -154,12 +154,12 @@ Georgia - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 Turkey - Government Agency + Government agency 1 @@ -169,12 +169,12 @@ - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 United States - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 diff --git a/build/fr/privacy.html b/build/fr/privacy.html index ef0a867..178b984 100644 --- a/build/fr/privacy.html +++ b/build/fr/privacy.html @@ -97,68 +97,102 @@ Oscar Wilde Écrivain et Poète (1891) + - - - Janvier – Juin 2016 - Résumé - - - - - Nombre total de requêtes - 13 - - - Requêtes non-gouvernementales informelles - 7 - - - Requêtes gouvernementales informelles - 6 - - - Assignations civiles - 0 -
[MediaWiki-commits] [Gerrit] user page updates - change (wikimedia/TransparencyReport-private)
Siddparmar has submitted this change and it was merged. Change subject: user page updates .. user page updates Change-Id: Icff763234b28599934e64f3f4f1dbfcc17184c5c --- M build/content.html M build/fr/content.html M build/fr/privacy.html M build/privacy.html M build/stylesheets/master.css M locales/en.yml M source/localizable/privacy.html.erb M source/stylesheets/master.css.scss 8 files changed, 357 insertions(+), 232 deletions(-) Approvals: Siddparmar: Verified; Looks good to me, approved diff --git a/build/content.html b/build/content.html index 3f15807..1fd9bb5 100644 --- a/build/content.html +++ b/build/content.html @@ -139,7 +139,7 @@ Canada - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 @@ -154,12 +154,12 @@ Georgia - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 Turkey - Government Agency + Government agency 1 @@ -169,12 +169,12 @@ - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 United States - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 diff --git a/build/fr/content.html b/build/fr/content.html index 6c67947..0eb4d59 100644 --- a/build/fr/content.html +++ b/build/fr/content.html @@ -139,7 +139,7 @@ Canada - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 @@ -154,12 +154,12 @@ Georgia - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 Turkey - Government Agency + Government agency 1 @@ -169,12 +169,12 @@ - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 United States - Politicians, Candidates, & Political Parties + Politicians, candidates, & political parties 1 diff --git a/build/fr/privacy.html b/build/fr/privacy.html index ef0a867..178b984 100644 --- a/build/fr/privacy.html +++ b/build/fr/privacy.html @@ -97,68 +97,102 @@ Oscar Wilde Écrivain et Poète (1891) + - - - Janvier – Juin 2016 - Résumé - - - - - Nombre total de requêtes - 13 - - - Requêtes non-gouvernementales informelles - 7 - - - Requêtes gouvernementales informelles - 6 - - - Assignations civiles - 0 - - - Assignation
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 392a671..a8dfd81 - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/300789 Change subject: Syncronize VisualEditor: 392a671..a8dfd81 .. Syncronize VisualEditor: 392a671..a8dfd81 Change-Id: I3bb98225d4a08ee935c81f80c721a9acac6c398a --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/89/300789/1 diff --git a/VisualEditor b/VisualEditor index 392a671..a8dfd81 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 392a67134cfb6c6a6c4d802e9ef3a9e845b922f4 +Subproject commit a8dfd811acb65c43982766283ab24c095921cd26 -- To view, visit https://gerrit.wikimedia.org/r/300789 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bb98225d4a08ee935c81f80c721a9acac6c398a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 392a671..a8dfd81 - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: 392a671..a8dfd81 .. Syncronize VisualEditor: 392a671..a8dfd81 Change-Id: I3bb98225d4a08ee935c81f80c721a9acac6c398a --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Jenkins-mwext-sync: Verified; Looks good to me, approved diff --git a/VisualEditor b/VisualEditor index 392a671..a8dfd81 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 392a67134cfb6c6a6c4d802e9ef3a9e845b922f4 +Subproject commit a8dfd811acb65c43982766283ab24c095921cd26 -- To view, visit https://gerrit.wikimedia.org/r/300789 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3bb98225d4a08ee935c81f80c721a9acac6c398a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync Gerrit-Reviewer: Jenkins-mwext-sync ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix debian-glue by working around it's exported path for whe... - change (integration/config)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/300790 Change subject: Fix debian-glue by working around it's exported path for where debs are saved .. Fix debian-glue by working around it's exported path for where debs are saved This will allow us to copy over the debs we created to our workspace. This is a workaround but will allow us to build deps for zuul :) Change-Id: Icd2b81805a6173f967a51d705be715b2521175b7 --- M jjb/operations-debs.yaml 1 file changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/90/300790/1 diff --git a/jjb/operations-debs.yaml b/jjb/operations-debs.yaml index efc6090..9a44b37 100644 --- a/jjb/operations-debs.yaml +++ b/jjb/operations-debs.yaml @@ -109,6 +109,30 @@ disable: true builders: - shell: | +# Workaround the path not being correctly exported. +# This makes sure we doint copy any prevous zuul versions +# we built. +export distributions=$(dpkg-parsechangelog --show-field distribution -lsource/debian/changelog) +export DISTS=$distributions +if [ "$DISTS" = "precise-wikimedia" ] +then +if ls /mnt/pbuilder/result/precise-amd64/zuul_* 1> /dev/null 2>&1; then +sudo rm -rf /mnt/pbuilder/result/precise-amd64/zuul_* +fi +fi +if [ "$DISTS" = "trusty-wikimedia" ] +then +if ls /mnt/pbuilder/result/trusty-amd64/zuul_* 1> /dev/null 2>&1; then +sudo rm -rf /mnt/pbuilder/result/trusty-amd64/zuul_* +fi +fi +if [ "$DISTS" = "jessie-wikimedia" ] +then +if ls /mnt/pbuilder/result/jessie-amd64/zuul_* 1> /dev/null 2>&1; then +sudo rm -rf /mnt/pbuilder/result/jessie-amd64/zuul_* +fi +fi +- shell: | # GIT_BRANCH is set to 'detached' :-( export GIT_BRANCH="$ZUUL_REF" if [ "$ZUUL_PIPELINE" == "gate-and-submit" ]; then @@ -135,6 +159,22 @@ export COWBUILDER_BASE="$BASEPATH" /usr/bin/build-and-provide-package +- shell: | +# Workaround the path not being correctly exported. +export distributions=$(dpkg-parsechangelog --show-field distribution -lsource/debian/changelog) +export DISTS=$distributions +if [ "$DISTS" = "precise-wikimedia" ] +then +cp /mnt/pbuilder/result/precise-amd64/zuul_* "$WORKSPACE" +fi +if [ "$DISTS" = "trusty-wikimedia" ] +then +cp /mnt/pbuilder/result/trusty-amd64/zuul_* "$WORKSPACE" +fi +if [ "$DISTS" = "jessie-wikimedia" ] +then +cp /mnt/pbuilder/result/jessie-amd64/zuul_* "$WORKSPACE" +fi - debian-glue-lintian - debian-glue-piuparts publishers: *debian-glue-publishers -- To view, visit https://gerrit.wikimedia.org/r/300790 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd2b81805a6173f967a51d705be715b2521175b7 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Paladox ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve how slashes are stripped from filenames - change (mediawiki/core)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300791 Change subject: Improve how slashes are stripped from filenames .. Improve how slashes are stripped from filenames * Add slash and backslash ('/' and '\') to $wgIllegalFileChars. * Replace illegal chars before removing paths in wfStripIllegalFilenameChars(). This way users trying to upload a file with slashes in the name will get a better filename suggestion (e.g. for 'Foo part 1/3.jpg', you previously got '3.jpg', now you'll get 'Foo part 1-3.jpg'). Uploading tools that don't special-case slashes will also behave better. Change-Id: Ib78f48a5f8c92e8ab2dc773ea6789b96b3662177 --- M includes/DefaultSettings.php M includes/GlobalFunctions.php 2 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/91/300791/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 1e60302..5926328 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -398,9 +398,13 @@ $wgEnableAsyncUploads = false; /** - * These are additional characters that should be replaced with '-' in filenames + * Additional characters that are not allowed in filenames. They are replaced with '-' when + * uploading. Like $wgLegalTitleChars, this is a regexp character class. + * + * Slashes and backslashes are disallowed regardless of this setting, but included here for + * completeness. */ -$wgIllegalFileChars = ":"; +$wgIllegalFileChars = ":\\/"; /** * What directory to place deleted uploads in. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 66e2440..e262c81 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3350,9 +3350,9 @@ } /** - * Replace all invalid characters with - - * Additional characters can be defined in $wgIllegalFileChars (see bug 20489) - * By default, $wgIllegalFileChars = ':' + * Replace all invalid characters with '-'. + * Additional characters can be defined in $wgIllegalFileChars (see T22489). + * By default, $wgIllegalFileChars includes ':', '/', '\'. * * @param string $name Filename to process * @return string @@ -3360,12 +3360,13 @@ function wfStripIllegalFilenameChars( $name ) { global $wgIllegalFileChars; $illegalFileChars = $wgIllegalFileChars ? "|[" . $wgIllegalFileChars . "]" : ''; - $name = wfBaseName( $name ); $name = preg_replace( "/[^" . Title::legalChars() . "]" . $illegalFileChars . "/", '-', $name ); + // $wgIllegalFileChars may not include '/' and '\', so we still need to do this + $name = wfBaseName( $name ); return $name; } -- To view, visit https://gerrit.wikimedia.org/r/300791 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib78f48a5f8c92e8ab2dc773ea6789b96b3662177 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move mw.UploadWizardDetails.makeTitleInFileNS to uw.TitleDet... - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300793 Change subject: Move mw.UploadWizardDetails.makeTitleInFileNS to uw.TitleDetailsWidget .. Move mw.UploadWizardDetails.makeTitleInFileNS to uw.TitleDetailsWidget It is the only place where it's used. Change-Id: I5d60a57bd3c6bed4c7c8aa524bf35a4498fd3571 --- M resources/details/uw.TitleDetailsWidget.js M resources/mw.UploadWizardDetails.js R tests/qunit/uw.TitleDetailsWidget.test.js 3 files changed, 24 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/93/300793/1 diff --git a/resources/details/uw.TitleDetailsWidget.js b/resources/details/uw.TitleDetailsWidget.js index bd7f5f3..9de3e37 100644 --- a/resources/details/uw.TitleDetailsWidget.js +++ b/resources/details/uw.TitleDetailsWidget.js @@ -1,5 +1,7 @@ ( function ( mw, uw, $, OO ) { + var NS_FILE = mw.config.get( 'wgNamespaceIds' ).file; + /** * A title field in UploadWizard's "Details" step form. * @@ -27,6 +29,24 @@ OO.inheritClass( uw.TitleDetailsWidget, uw.DetailsWidget ); /** +* Reliably turn input into a MediaWiki title that is located in the File: namespace +* +* var title = uw.TitleDetailsWidget.static.makeTitleInFileNS( 'filename.ext' ); +* +* @static +* @param {string} filename Desired file name; optionally with File: namespace prefixed +* @return {mw.Title|null} +*/ + uw.TitleDetailsWidget.static.makeTitleInFileNS = function ( filename ) { + var mwTitle = mw.Title.newFromText( filename, NS_FILE ); + if ( mwTitle && mwTitle.getNamespaceId() !== NS_FILE ) { + // Force file namespace + mwTitle = mw.Title.makeTitle( NS_FILE, filename ); + } + return mwTitle; + }; + + /** * @inheritdoc */ uw.TitleDetailsWidget.prototype.pushPending = function () { @@ -53,7 +73,7 @@ } extRegex = new RegExp( '\\.' + this.extension + '$', 'i' ); cleaned = value.replace( extRegex, '' ).replace( /\.+$/g, '' ).trim(); - title = mw.UploadWizardDetails.makeTitleInFileNS( cleaned + '.' + this.extension ); + title = uw.TitleDetailsWidget.static.makeTitleInFileNS( cleaned + '.' + this.extension ); return title; }; @@ -120,7 +140,7 @@ try { titleString = result.unique.title || result.title; - titleString = mw.UploadWizardDetails.makeTitleInFileNS( titleString ).getPrefixedText(); + titleString = uw.TitleDetailsWidget.static.makeTitleInFileNS( titleString ).getPrefixedText(); } catch ( e ) { // Unparseable result? This shouldn't happen, we checked for that earlier... errors.push( mw.message( 'mwe-upwiz-unparseable-title' ) ); diff --git a/resources/mw.UploadWizardDetails.js b/resources/mw.UploadWizardDetails.js index 9a59e32..10ec494 100644 --- a/resources/mw.UploadWizardDetails.js +++ b/resources/mw.UploadWizardDetails.js @@ -214,24 +214,6 @@ } }; - /** -* Reliably turn input into a MediaWiki title that is located in the File: namespace -* -* var title = mw.UploadWizardDetails.makeTitleInFileNS( 'filename.ext' ); -* -* @static -* @param {string} filename Desired file name; optionally with File: namespace prefixed -* @return {mw.Title|null} -*/ - mw.UploadWizardDetails.makeTitleInFileNS = function ( filename ) { - var mwTitle = mw.Title.newFromText( filename, NS_FILE ); - if ( mwTitle && mwTitle.getNamespaceId() !== NS_FILE ) { - // Force file namespace - mwTitle = mw.Title.makeTitle( NS_FILE, filename ); - } - return mwTitle; - }; - mw.UploadWizardDetails.prototype = { // Has this details object been attached to the DOM already? diff --git a/tests/qunit/mw.UploadWizardDetails.test.js b/tests/qunit/uw.TitleDetailsWidget.test.js similarity index 86% rename from tests/qunit/mw.UploadWizardDetails.test.js rename to tests/qunit/uw.TitleDetailsWidget.test.js index 1ef8ae5..4274b44 100644 --- a/tests/qunit/mw.UploadWizardDetails.test.js +++ b/tests/qunit/uw.TitleDetailsWidget.test.js @@ -27,9 +27,9 @@ desc: 'filename starting with file:' } ]; - QUnit.module( 'ext.uploadWizard/mw.UploadWizardDetails.test.js', QUnit.newMwEnvironment() ); + QUnit.module( 'uw.TitleDetailsWidget', QUnit.newMwEnvironment() ); - QUnit.test( 'makeTitleInFileNS(
[MediaWiki-commits] [Gerrit] mw.Title: Use $wgIllegalFileChars for file title checking - change (mediawiki/core)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300792 Change subject: mw.Title: Use $wgIllegalFileChars for file title checking .. mw.Title: Use $wgIllegalFileChars for file title checking mw.Title.newFromFileName() will now correctly use $wgIllegalFileChars, rather than partially and incorrectly duplicating it. $wgIllegalFileChars is currently defined to contain ':', '/' and '\'. Previously we incorrectly did not filter out backslashes '\'. The hash '#' is already disallowed by $wgLegalTitleChars. Bug: T140222 Change-Id: I17e3ef61e04ae002ef576c9416c8f265ee000e89 --- M includes/resourceloader/ResourceLoaderStartUpModule.php M resources/src/mediawiki/mediawiki.Title.js 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/92/300792/1 diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 7b2d532..8ecd20b 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -39,7 +39,7 @@ return $this->configVars[$hash]; } - global $wgContLang; + global $wgContLang, $wgIllegalFileChars; $conf = $this->getConfig(); // We can't use Title::newMainPage() if 'mainpage' is in @@ -107,6 +107,7 @@ 'wgResourceLoaderMaxQueryLength' => $conf->get( 'ResourceLoaderMaxQueryLength' ), 'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces, 'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ), + 'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $wgIllegalFileChars ), 'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ), 'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ), 'wgResourceLoaderLegacyModules' => self::getLegacyModules(), diff --git a/resources/src/mediawiki/mediawiki.Title.js b/resources/src/mediawiki/mediawiki.Title.js index ff4d1c2..4c57faa 100644 --- a/resources/src/mediawiki/mediawiki.Title.js +++ b/resources/src/mediawiki/mediawiki.Title.js @@ -213,7 +213,7 @@ }, // slash, colon (not supported by file systems like NTFS/Windows, Mac OS 9 [:], ext4 [/]) { - pattern: /[:\/#]/g, + pattern: new RegExp( '[' + mw.config.get( 'wgIllegalFileChars', '' ) + ']', 'g' ), replace: '-', fileRule: true }, -- To view, visit https://gerrit.wikimedia.org/r/300792 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17e3ef61e04ae002ef576c9416c8f265ee000e89 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Various minor cleanups - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300795 Change subject: Various minor cleanups .. Various minor cleanups * mw.UploadWizardUploadInterface: Remove check for C:\fakepath, this no longer happens since we switched to the HTML5 File API. * mw.ApiUploadFormDataHandler: Correct documentation. * SpecialUploadWizard: Don't customize the value of 'wgIllegalFileChars', we already add '#' in JS when using it. Change-Id: Iaa84a352da943d83a6d115b3bbaa352876106e81 --- M includes/specials/SpecialUploadWizard.php M resources/handlers/mw.ApiUploadFormDataHandler.js M resources/mw.UploadWizardUploadInterface.js 3 files changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/95/300795/1 diff --git a/includes/specials/SpecialUploadWizard.php b/includes/specials/SpecialUploadWizard.php index 5727446..fc20b9a 100644 --- a/includes/specials/SpecialUploadWizard.php +++ b/includes/specials/SpecialUploadWizard.php @@ -248,7 +248,7 @@ [ 'UploadWizardConfig' => $config, 'wgFileCanRotate' => $bitmapHandler->canRotate(), - 'wgIllegalFileChars' => $wgIllegalFileChars . '#', + 'wgIllegalFileChars' => $wgIllegalFileChars, ] ); } diff --git a/resources/handlers/mw.ApiUploadFormDataHandler.js b/resources/handlers/mw.ApiUploadFormDataHandler.js index 9f75a56..aab1c2a 100644 --- a/resources/handlers/mw.ApiUploadFormDataHandler.js +++ b/resources/handlers/mw.ApiUploadFormDataHandler.js @@ -3,7 +3,7 @@ * Represents an object which configures an html5 FormData object to upload. * Large files are uploaded in chunks. * -* @param {mw.UploadWizardUploadInterface} upload +* @param {mw.UploadWizardUpload} upload */ mw.ApiUploadFormDataHandler = function ( upload, api ) { var handler = this; diff --git a/resources/mw.UploadWizardUploadInterface.js b/resources/mw.UploadWizardUploadInterface.js index f676b64..77313f8 100644 --- a/resources/mw.UploadWizardUploadInterface.js +++ b/resources/mw.UploadWizardUploadInterface.js @@ -350,8 +350,6 @@ mw.UploadWizardUploadInterface.prototype.updateFilename = function () { var $div, path = this.getFilename(); - // get basename of file; some browsers do this C:\fakepath\something - path = path.replace( /\w:.*\\(.*)$/, '$1' ); // visible filename this.$form.find( '.mwe-upwiz-visible-file-filename-text' ) -- To view, visit https://gerrit.wikimedia.org/r/300795 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa84a352da943d83a6d115b3bbaa352876106e81 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] uw.TitleDetailsWidget: Check for $wgIllegalFileChars client-... - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300796 Change subject: uw.TitleDetailsWidget: Check for $wgIllegalFileChars client-side .. uw.TitleDetailsWidget: Check for $wgIllegalFileChars client-side Also remove 'wgIllegalFileChars' from our JS config variables, as it's provided by MediaWiki now. Bug: T140222 Depends-On: I17e3ef61e04ae002ef576c9416c8f265ee000e89 Change-Id: I979e1707f6287e6f69841b0f28a6f90c472d42e0 --- M includes/specials/SpecialUploadWizard.php M resources/details/uw.TitleDetailsWidget.js M tests/qunit/uw.TitleDetailsWidget.test.js 3 files changed, 16 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/96/300796/1 diff --git a/includes/specials/SpecialUploadWizard.php b/includes/specials/SpecialUploadWizard.php index fc20b9a..dd9dd48 100644 --- a/includes/specials/SpecialUploadWizard.php +++ b/includes/specials/SpecialUploadWizard.php @@ -173,8 +173,6 @@ * @param subpage, e.g. the "foo" in Special:UploadWizard/foo */ public function addJsVars( $subPage ) { - global $wgIllegalFileChars; - $config = UploadWizardConfig::getConfig( $this->campaign ); if ( array_key_exists( 'trackingCategory', $config ) ) { @@ -248,7 +246,6 @@ [ 'UploadWizardConfig' => $config, 'wgFileCanRotate' => $bitmapHandler->canRotate(), - 'wgIllegalFileChars' => $wgIllegalFileChars, ] ); } diff --git a/resources/details/uw.TitleDetailsWidget.js b/resources/details/uw.TitleDetailsWidget.js index 9de3e37..6a46c2b 100644 --- a/resources/details/uw.TitleDetailsWidget.js +++ b/resources/details/uw.TitleDetailsWidget.js @@ -29,20 +29,27 @@ OO.inheritClass( uw.TitleDetailsWidget, uw.DetailsWidget ); /** -* Reliably turn input into a MediaWiki title that is located in the File: namespace +* Reliably turn input into a MediaWiki title that is located in the 'File:' namespace. +* Also applies file-specific checks ($wgIllegalFileChars). * * var title = uw.TitleDetailsWidget.static.makeTitleInFileNS( 'filename.ext' ); * * @static -* @param {string} filename Desired file name; optionally with File: namespace prefixed +* @param {string} filename Desired file name; optionally with 'File:' namespace prefixed * @return {mw.Title|null} */ uw.TitleDetailsWidget.static.makeTitleInFileNS = function ( filename ) { - var mwTitle = mw.Title.newFromText( filename, NS_FILE ); + var + mwTitle = mw.Title.newFromText( filename, NS_FILE ), + illegalFileChars = new RegExp( '[' + mw.config.get( 'wgIllegalFileChars', '' ) + ']' ); if ( mwTitle && mwTitle.getNamespaceId() !== NS_FILE ) { // Force file namespace mwTitle = mw.Title.makeTitle( NS_FILE, filename ); } + if ( mwTitle && illegalFileChars.test( mwTitle.getMainText() ) ) { + // Consider the title invalid if it contains characters disallowed in file names + mwTitle = null; + } return mwTitle; }; diff --git a/tests/qunit/uw.TitleDetailsWidget.test.js b/tests/qunit/uw.TitleDetailsWidget.test.js index 4274b44..25f115a 100644 --- a/tests/qunit/uw.TitleDetailsWidget.test.js +++ b/tests/qunit/uw.TitleDetailsWidget.test.js @@ -25,6 +25,10 @@ filename: 'file:foo_bar.jpg', prefixedText: 'File:Foo bar.jpg', desc: 'filename starting with file:' + }, { + filename: 'Foo part 1/2.jpg', + prefixedText: null, + desc: 'filename with characters disallowed in file names' } ]; QUnit.module( 'uw.TitleDetailsWidget', QUnit.newMwEnvironment() ); @@ -33,8 +37,9 @@ var makeTitleInFileNS = mw.UploadWizardDetails.makeTitleInFileNS; $.each( makeTitleInFileNSCases, function ( i, test ) { + var title = makeTitleInFileNS( test.filename ); QUnit.equal( - makeTitleInFileNS( test.filename ).getPrefixedText(), + title ? title.getPrefixedText() : title, test.prefixedText, test.desc ); -- To view, visit https://gerrit.wikimedia.org/r/300796 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I979e1707f6287e6f69841b0f28a6f90c472d
[MediaWiki-commits] [Gerrit] Remove unused localisation messages - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300798 Change subject: Remove unused localisation messages .. Remove unused localisation messages 'mwe-upwiz-error-signature-bad-chars' and 'mwe-upwiz-error-bad-chars' have been introduced in cdd5def2f95aa82ed00a81a7c78a50dab4e6fb4c (2010), but they have never been used. Change-Id: I10410574ccadd380cb76fb45fa205b5ff7f0ec74 --- M extension.json M i18n/en.json M i18n/qqq.json 3 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/98/300798/1 diff --git a/extension.json b/extension.json index e857877..65e2c89 100644 --- a/extension.json +++ b/extension.json @@ -436,12 +436,10 @@ "mwe-upwiz-error-heading", "mwe-upwiz-error-signature-too-long", "mwe-upwiz-error-signature-too-short", - "mwe-upwiz-error-signature-bad-chars", "mwe-upwiz-error-blank", "mwe-upwiz-error-too-long", "mwe-upwiz-error-too-short", "mwe-upwiz-error-bad-descriptions", - "mwe-upwiz-error-bad-chars", "mwe-upwiz-error-title-blacklisted", "mwe-upwiz-error-title-badchars", "mwe-upwiz-error-title-senselessimagename", diff --git a/i18n/en.json b/i18n/en.json index e94f8b8..65a390b 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -206,12 +206,10 @@ "mwe-upwiz-error-heading": "The heading must be a number between 0 and 360.", "mwe-upwiz-error-signature-too-long": "Your signature is too long.\nMake it shorter than $1 {{PLURAL:$1|character|characters}}.", "mwe-upwiz-error-signature-too-short": "Your signature is too short.\nMake it longer than $1 {{PLURAL:$1|character|characters}}.", - "mwe-upwiz-error-signature-bad-chars": "Your signature contains symbols that are not allowed.\nPlease do not use wikitext or HTML here, just your username or real name.", "mwe-upwiz-error-blank": "This field is required.", "mwe-upwiz-error-too-long": "This entry is too long.\nPlease make sure this entry is at most $1 {{PLURAL:$1|character|characters}}.", "mwe-upwiz-error-too-short": "This entry is too short.\nPlease make sure this entry is at least $1 {{PLURAL:$1|character|characters}}.", "mwe-upwiz-error-bad-descriptions": "There are problems with some of the descriptions.", - "mwe-upwiz-error-bad-chars": "This entry contains symbols that are not allowed.\nPlease do not use wikitext or HTML here.", "mwe-upwiz-error-title-blacklisted": "This title contains some undesirable text. Please revise it.", "mwe-upwiz-error-title-badchars": "This title contains some undesirable characters. Please remove them.", "mwe-upwiz-error-title-senselessimagename": "Please make this title more meaningful.", diff --git a/i18n/qqq.json b/i18n/qqq.json index cc9f32b..d6ea2a9 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -230,12 +230,10 @@ "mwe-upwiz-error-heading": "Error message shown when an invalid heading (the direction the camera was pointing) is entered.", "mwe-upwiz-error-signature-too-long": "Used as error message. Parameters:\n* $1 - maximum number of characters for the signature\n{{Related|Mwe-upwiz-error-signature}}", "mwe-upwiz-error-signature-too-short": "Used as error message. Parameters:\n* $1 - minimum number of characters for the signature\n{{Related|Mwe-upwiz-error-signature}}", - "mwe-upwiz-error-signature-bad-chars": "Used as error message.\n{{Related|Mwe-upwiz-error-signature}}", "mwe-upwiz-error-blank": "{{Identical|Required}}", "mwe-upwiz-error-too-long": "Used as error message. Parameters:\n* $1 - maximum number of characters\nSee also:\n* {{msg-mw|Mwe-upwiz-error-too-short}}", "mwe-upwiz-error-too-short": "Used as error message. Parameters:\n* $1 - minimum number of characters\nSee also:\n* {{msg-mw|Mwe-upwiz-error-too-long}}", "mwe-upwiz-error-bad-descriptions": "Used as error message.", - "mwe-upwiz-error-bad-chars": "Error message shown to the user when they have entered characters that aren't allowed.", "mwe-upwiz-error-title-blacklisted": "Error message shown to the user when they have entered a file name that matches the 'blacklist' of banned words.", "mwe-upwiz-error-title-badchars": "Error message shown to the user when they have entered a file name that matches the 'blacklist' of banned characters.", "mwe-upwiz-error-title-senselessimagename": "Error message shown to the user when they have entered a file name that looks like an
[MediaWiki-commits] [Gerrit] Stop using and remove mw.UploadWizard.sanitizeFilename - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300797 Change subject: Stop using and remove mw.UploadWizard.sanitizeFilename .. Stop using and remove mw.UploadWizard.sanitizeFilename It was disallowing some perfectly valid characters (like '%') and letting through many invalid ones (like '['). mw.Title.newFromFileName() is the right function to use to turn anything into a file name, and we were already using it in some places. Change-Id: I57a94cf12d58c7e1cddaaba42484039e87ac0bbb --- M UploadWizardHooks.php M resources/handlers/mw.ApiUploadFormDataHandler.js M resources/mw.UploadWizard.js M resources/mw.UploadWizardUpload.js M resources/mw.UploadWizardUploadInterface.js M resources/transports/mw.FormDataTransport.js D tests/qunit/mw.UploadWizard.test.js 7 files changed, 7 insertions(+), 65 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/97/300797/1 diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php index d4f6382..8a47270 100644 --- a/UploadWizardHooks.php +++ b/UploadWizardHooks.php @@ -169,7 +169,6 @@ 'tests/qunit/transports/mw.FormDataTransport.test.js', 'tests/qunit/uw.EventFlowLogger.test.js', 'tests/qunit/uw.ConcurrentQueue.test.js', - 'tests/qunit/mw.UploadWizard.test.js', 'tests/qunit/mw.UploadWizardUpload.test.js', 'tests/qunit/mw.UploadWizardLicenseInput.test.js', 'tests/qunit/mw.FlickrChecker.test.js', diff --git a/resources/handlers/mw.ApiUploadFormDataHandler.js b/resources/handlers/mw.ApiUploadFormDataHandler.js index aab1c2a..57a30df 100644 --- a/resources/handlers/mw.ApiUploadFormDataHandler.js +++ b/resources/handlers/mw.ApiUploadFormDataHandler.js @@ -56,7 +56,7 @@ handler.beginTime = ( new Date() ).getTime(); handler.upload.ui.setStatus( 'mwe-upwiz-transport-started' ); handler.upload.ui.showTransportProgress(); - return handler.transport.upload( handler.upload.file ) + return handler.transport.upload( handler.upload.file, handler.upload.title.getMainText() ) .progress( function ( fraction ) { if ( handler.upload.state === 'aborted' ) { handler.transport.xhr.abort(); diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js index fe559e6..ae49db2 100644 --- a/resources/mw.UploadWizard.js +++ b/resources/mw.UploadWizard.js @@ -462,18 +462,6 @@ }; /** -* Sanitizes a filename for use as a File: page title -* -* @static -* @param {string} filename Pre-sanitization filename. -* @return {string} Filename sanitized for use as a title. -*/ - mw.UploadWizard.sanitizeFilename = function ( filename ) { - var illegalCharRegex = new RegExp( '[' + mw.config.get( 'wgIllegalFileChars', '' ) + '#:%]', 'g' ); - return filename.replace( illegalCharRegex, '-' ); - }; - - /** * Get the own work and third party licensing deeds if they are needed. * * @static diff --git a/resources/mw.UploadWizardUpload.js b/resources/mw.UploadWizardUpload.js index 282bb90..4168b6a 100644 --- a/resources/mw.UploadWizardUpload.js +++ b/resources/mw.UploadWizardUpload.js @@ -480,7 +480,7 @@ * @param {string} title Unsanitized title. */ mw.UploadWizardUpload.prototype.setTitle = function ( title ) { - this.title = mw.Title.newFromFileName( mw.UploadWizard.sanitizeFilename( title ) ); + this.title = mw.Title.newFromFileName( title ); }; /** diff --git a/resources/mw.UploadWizardUploadInterface.js b/resources/mw.UploadWizardUploadInterface.js index 77313f8..4643ef9 100644 --- a/resources/mw.UploadWizardUploadInterface.js +++ b/resources/mw.UploadWizardUploadInterface.js @@ -353,7 +353,7 @@ // visible filename this.$form.find( '.mwe-upwiz-visible-file-filename-text' ) - .text( mw.UploadWizard.sanitizeFilename( path ) ); + .text( path ); if ( !this.isFilled ) { $div = $( this.div ); diff --git a/resources/transports/mw.FormDataTransport.js b/resources/transports/mw.FormDataTransport.js index e637d17..2f6cbf9 100644 --- a/resources/transports/mw.FormDataTransport.js +++ b/resources/transports/mw.FormDataTransport.js @@ -104,14 +104,16 @@ /** * Start the upload with the provi
[MediaWiki-commits] [Gerrit] Improve errors about invalid filenames - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300799 Change subject: Improve errors about invalid filenames .. Improve errors about invalid filenames We had two different error messages about invalid filenames. One was awful, the other pretty good but incomplete. This replaces them with one. Message changes: * 'mwe-upwiz-error-title-badchars' removed. * 'mwe-upwiz-unparseable-title' renamed to 'mwe-upwiz-error-title-invalid' with minor changes (translations are compatible, but should be fuzzied). Bug: T140222 Change-Id: I9caab08b2fc78ffbd2568ced03296cdcf9acc40c --- M extension.json M i18n/en.json M i18n/qqq.json M resources/details/uw.TitleDetailsWidget.js M resources/mw.QuickTitleChecker.js M resources/mw.UploadWizardDetails.js 6 files changed, 9 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/99/300799/1 diff --git a/extension.json b/extension.json index 65e2c89..22b724c 100644 --- a/extension.json +++ b/extension.json @@ -441,9 +441,9 @@ "mwe-upwiz-error-too-short", "mwe-upwiz-error-bad-descriptions", "mwe-upwiz-error-title-blacklisted", - "mwe-upwiz-error-title-badchars", "mwe-upwiz-error-title-senselessimagename", "mwe-upwiz-error-title-hosting", + "mwe-upwiz-error-title-invalid", "mwe-upwiz-error-title-thumbnail", "mwe-upwiz-error-title-fileexists-shared-forbidden", "mwe-upwiz-error-title-double-apostrophe", @@ -519,7 +519,6 @@ "mwe-upwiz-categories-missing", "mwe-upwiz-thumbnail-failed", "mwe-upwiz-unparseable-filename", - "mwe-upwiz-unparseable-title", "mwe-upwiz-subhead-bugs", "mwe-upwiz-subhead-alt-upload", "mwe-upwiz-subhead-alternatives", diff --git a/i18n/en.json b/i18n/en.json index 65a390b..3ef67c8 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -211,7 +211,6 @@ "mwe-upwiz-error-too-short": "This entry is too short.\nPlease make sure this entry is at least $1 {{PLURAL:$1|character|characters}}.", "mwe-upwiz-error-bad-descriptions": "There are problems with some of the descriptions.", "mwe-upwiz-error-title-blacklisted": "This title contains some undesirable text. Please revise it.", - "mwe-upwiz-error-title-badchars": "This title contains some undesirable characters. Please remove them.", "mwe-upwiz-error-title-senselessimagename": "Please make this title more meaningful.", "mwe-upwiz-error-title-hosting": "This looks like a file you obtained from another image host. Please make the title more meaningful. Also, double check that you have the rights to publish it on this site.", "mwe-upwiz-error-title-thumbnail": "This looks like a thumbnail title. Please do not upload thumbnails back to the same wiki. Otherwise, please fix the filename so it is more meaningful, and does not have the thumbnail prefix.", @@ -304,7 +303,7 @@ "mwe-upwiz-categories-missing": "One of the categories lacks a description page. Are you sure you typed the name correctly?", "mwe-upwiz-thumbnail-failed": "The upload succeeded, but the server could not get a preview thumbnail.", "mwe-upwiz-unparseable-filename": "Could not understand the filename \"$1\".", - "mwe-upwiz-unparseable-title": "This title is invalid. Make sure to remove characters like square brackets, colons, comparison operators, pipes and curly brackets.", + "mwe-upwiz-error-title-invalid": "This title is invalid. Make sure to remove characters like square brackets, colons, slashes, comparison operators, pipes and curly brackets.", "mwe-upwiz-subhead-bugs": "[$1 Known issues]", "mwe-upwiz-subhead-alt-upload": "Back to the old form", "mwe-upwiz-subhead-alternatives": "Alternative upload methods", diff --git a/i18n/qqq.json b/i18n/qqq.json index d6ea2a9..1d522af 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -235,7 +235,6 @@ "mwe-upwiz-error-too-short": "Used as error message. Parameters:\n* $1 - minimum number of characters\nSee also:\n* {{msg-mw|Mwe-upwiz-error-too-long}}", "mwe-upwiz-error-bad-descriptions": "Used as error message.", "mwe-upwiz-error-title-blacklisted": "Error message shown to the user when they have entered a file name that matches the 'blacklist' of banned words.", - "mwe-upwiz-error-title-badchars": "Error message shown to the user when they have en
[MediaWiki-commits] [Gerrit] Do not set 'wgSiteName' JS config var - change (mediawiki...UploadWizard)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/300794 Change subject: Do not set 'wgSiteName' JS config var .. Do not set 'wgSiteName' JS config var It is already being set in MediaWiki core since r57858 (0df1f91e53210faba80ee669bc1800f5d4742fd0). Change-Id: If8064173127e69893023b2edf6443014362a748b --- M includes/specials/SpecialUploadWizard.php 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/94/300794/1 diff --git a/includes/specials/SpecialUploadWizard.php b/includes/specials/SpecialUploadWizard.php index 25406e4..5727446 100644 --- a/includes/specials/SpecialUploadWizard.php +++ b/includes/specials/SpecialUploadWizard.php @@ -173,7 +173,7 @@ * @param subpage, e.g. the "foo" in Special:UploadWizard/foo */ public function addJsVars( $subPage ) { - global $wgSitename, $wgIllegalFileChars; + global $wgIllegalFileChars; $config = UploadWizardConfig::getConfig( $this->campaign ); @@ -247,9 +247,6 @@ $this->getOutput()->addJsConfigVars( [ 'UploadWizardConfig' => $config, - - // Site name is a true global not specific to Upload Wizard - 'wgSiteName' => $wgSitename, 'wgFileCanRotate' => $bitmapHandler->canRotate(), 'wgIllegalFileChars' => $wgIllegalFileChars . '#', ] -- To view, visit https://gerrit.wikimedia.org/r/300794 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8064173127e69893023b2edf6443014362a748b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add golang images - change (operations...toollabs-images)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/300800 Change subject: Add golang images .. Add golang images Change-Id: Ibac3c81a434c9a8f426ec8e8e745d2f0d9396af8 --- M build.py A golang/base/.dockerignore A golang/base/Dockerfile.template A golang/web/.dockerignore A golang/web/Dockerfile.template 5 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/docker-images/toollabs-images refs/changes/00/300800/1 diff --git a/build.py b/build.py index 3cebbcc..70351f1 100755 --- a/build.py +++ b/build.py @@ -36,6 +36,9 @@ # Python refers to python3, because it is 2016! 'python/base': [ 'python/web', +], +'golang/base': [ +'golang/web', ] }, } diff --git a/golang/base/.dockerignore b/golang/base/.dockerignore new file mode 100644 index 000..689cf97 --- /dev/null +++ b/golang/base/.dockerignore @@ -0,0 +1 @@ +Dockerfile.template diff --git a/golang/base/Dockerfile.template b/golang/base/Dockerfile.template new file mode 100644 index 000..58ac034 --- /dev/null +++ b/golang/base/Dockerfile.template @@ -0,0 +1,5 @@ +# Toollabs Golang runtime image +# Name: docker-registry.tools.wmflabs.org/toollabs-golang +FROM {registry}/{image_prefix}-base + +RUN apt-get install --yes -t jessie-backports golang-go diff --git a/golang/web/.dockerignore b/golang/web/.dockerignore new file mode 100644 index 000..689cf97 --- /dev/null +++ b/golang/web/.dockerignore @@ -0,0 +1 @@ +Dockerfile.template diff --git a/golang/web/Dockerfile.template b/golang/web/Dockerfile.template new file mode 100644 index 000..dc9cea0 --- /dev/null +++ b/golang/web/Dockerfile.template @@ -0,0 +1,5 @@ +# Toollabs golang webserver image +# Name: docker-registry.tools.wmflabs.org/toollabs-golang-web +FROM {registry}/{image_prefix}-golang-base + +RUN apt-get install --yes toollabs-webservice -- To view, visit https://gerrit.wikimedia.org/r/300800 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibac3c81a434c9a8f426ec8e8e745d2f0d9396af8 Gerrit-PatchSet: 1 Gerrit-Project: operations/docker-images/toollabs-images Gerrit-Branch: master Gerrit-Owner: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Wikidata to default interwikis - change (mediawiki/core)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/300801 Change subject: Add Wikidata to default interwikis .. Add Wikidata to default interwikis Change-Id: I558e9a0b6216ab91ef5fd5976b8718db51d1ffe0 --- M maintenance/interwiki.list M maintenance/interwiki.sql 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/01/300801/1 diff --git a/maintenance/interwiki.list b/maintenance/interwiki.list index 9104fd7..b1e0fa4 100644 --- a/maintenance/interwiki.list +++ b/maintenance/interwiki.list @@ -61,6 +61,7 @@ wiki|http://c2.com/cgi/wiki?$1|0| wikia|http://www.wikia.com/wiki/$1|0| wikibooks|https://en.wikibooks.org/wiki/$1|0|https://en.wikibooks.org/w/api.php +wikidata|https://www.wikidata.org/wiki/$1|0|https://www.wikidata.org/w/api.php wikif1|http://www.wikif1.org/$1|0| wikihow|http://www.wikihow.com/$1|0|http://www.wikihow.com/api.php wikinfo|http://wikinfo.co/English/index.php/$1|0| diff --git a/maintenance/interwiki.sql b/maintenance/interwiki.sql index 12352e7..b7d1a84 100644 --- a/maintenance/interwiki.sql +++ b/maintenance/interwiki.sql @@ -63,6 +63,7 @@ ('wiki','http://c2.com/cgi/wiki?$1',0,''), ('wikia','http://www.wikia.com/wiki/$1',0,''), ('wikibooks','https://en.wikibooks.org/wiki/$1',0,'https://en.wikibooks.org/w/api.php'), +('wikidata','https://www.wikidata.org/wiki/$1',0,'https://www.wikidata.org/w/api.php'), ('wikif1','http://www.wikif1.org/$1',0,''), ('wikihow','http://www.wikihow.com/$1',0,'http://www.wikihow.com/api.php'), ('wikinfo','http://wikinfo.co/English/index.php/$1',0,''), -- To view, visit https://gerrit.wikimedia.org/r/300801 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I558e9a0b6216ab91ef5fd5976b8718db51d1ffe0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MaxSem ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Convert panoramiopicker.py to requests - change (pywikibot/core)
MtDu has uploaded a new change for review. https://gerrit.wikimedia.org/r/300802 Change subject: Convert panoramiopicker.py to requests .. Convert panoramiopicker.py to requests Bug: T130522 Change-Id: If73276b61433831ef6edcd768b6d7c64d7db847f --- M scripts/panoramiopicker.py 1 file changed, 7 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/02/300802/1 diff --git a/scripts/panoramiopicker.py b/scripts/panoramiopicker.py index a971687..f15485a 100644 --- a/scripts/panoramiopicker.py +++ b/scripts/panoramiopicker.py @@ -15,6 +15,7 @@ import hashlib import json import re +import requests import socket import StringIO @@ -27,11 +28,6 @@ from pywikibot.tools import PY2 from scripts import imagerecat, upload - -if not PY2: -from urllib.request import urlopen -else: -from urllib import urlopen try: from pywikibot.userinterfaces.gui import Tkdialog @@ -57,7 +53,7 @@ TODO: Add exception handling """ -imageFile = urlopen(photoUrl).read() +imageFile = requests.get(photoUrl).content return StringIO.StringIO(imageFile) @@ -81,8 +77,8 @@ def getLicense(photoInfo): """Adding license to the Panoramio API with a beautiful soup hack.""" photoInfo['license'] = u'c' -page = urlopen(photoInfo.get(u'photo_url')) -data = page.read() +page = requests.get(photoInfo.get(u'photo_url')) +data = page.content soup = BeautifulSoup(data) if soup.find("div", {'id': 'photo-info'}): pointer = soup.find("div", {'id': 'photo-info'}) @@ -266,8 +262,9 @@ try: if tries < maxtries: tries += 1 -panoramioApiPage = urlopen(url % (photoset, i, i + interval)) -contents = panoramioApiPage.read().decode('utf-8') +panoramioApiPage = requests.get(url % (photoset, i, i + interval)) +panoramioApiPage.decoding = 'utf-8' +contents = panoramioApiPage.text gotInfo = True i += interval else: -- To view, visit https://gerrit.wikimedia.org/r/300802 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If73276b61433831ef6edcd768b6d7c64d7db847f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: MtDu ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Convert to 1.25+ extension.json - change (mediawiki...SecureHTML)
Fo0bar has uploaded a new change for review. https://gerrit.wikimedia.org/r/300803 Change subject: Convert to 1.25+ extension.json .. Convert to 1.25+ extension.json Backwards compatible with 1.23. Change-Id: I15a312662917ddb9c9743fd129e3737f4973cfd6 --- M README A SecureHTML.hooks.php D SecureHTML.i18n.php M SecureHTML.php A extension.json 5 files changed, 124 insertions(+), 115 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecureHTML refs/changes/03/300803/1 diff --git a/README b/README index d8ac7d2..3296c90 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Secure HTML -Copyright (C) 2012 Ryan Finnie +Copyright (C) 2012-2016 Ryan Finnie Lets you include arbitrary HTML in an authorized and secure way http://www.mediawiki.org/wiki/Extension:Secure_HTML diff --git a/SecureHTML.hooks.php b/SecureHTML.hooks.php new file mode 100644 index 000..762e383 --- /dev/null +++ b/SecureHTML.hooks.php @@ -0,0 +1,62 @@ +setHook( $wgSecureHTMLTag, array( __CLASS__, 'secureHTMLRender' ) ); + } + + function secureHTMLRender( $input, $argv, $parser, $frame ) { + global $wgSecureHTMLSecrets; + + # The hash attribute is required. + if ( !isset( $argv['hash'] ) ) { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-hashrequired' ) ) ); + } + + # If the array is empty, there is no possible way this will work. + if ( count( $wgSecureHTMLSecrets ) === 0 ) { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-nokeys' ) ) ); + } + + # Get a list of key names. + $keynames = array_keys( $wgSecureHTMLSecrets ); + + # If the desired key name is not available, assume the first one. + $keyname = ( isset( $argv['keyname'] ) ? $argv['keyname'] : $keynames[0] ); + + # Key secret configuration. + $keyalgorithm = 'sha256'; + if ( !array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { + # To avoid leaking the existence of a key name by unauthorized users, + # perform a dummy HMAC SHA256 (mitigate timing attacks), then + # respond with "invalid hash", instead of something like "invalid key + # name". + $testhash = hash_hmac( 'sha256', $input, '' ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); + } + if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { + if ( array_key_exists( 'secret', $wgSecureHTMLSecrets[$keyname] ) ) { + $keysecret = $wgSecureHTMLSecrets[$keyname]['secret']; + } else { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); + } + if ( array_key_exists( 'algorithm', $wgSecureHTMLSecrets[$keyname] ) ) { + $keyalgorithm = $wgSecureHTMLSecrets[$keyname]['algorithm']; + } + } else { + $keysecret = $wgSecureHTMLSecrets[$keyname]; + } + + # Compute a test hash. + $testhash = hash_hmac( $keyalgorithm, $input, $keysecret ); + + # If the test hash matches the supplied hash, return the raw HTML. Otherwise, error. + if ( $testhash === $argv['hash'] ) { + return( array( $input, 'markerType' => 'nowiki' ) ); + } else { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); + } + } + +} diff --git a/SecureHTML.i18n.php b/SecureHTML.i18n.php deleted file mode 100644 index 7d6faac..000 --- a/SecureHTML.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim2c9b1ded6737f38f' ) ) { - function wfJsonI18nShim2c9b1ded6737f38f( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - fo
[MediaWiki-commits] [Gerrit] Convert to 1.25+ extension.json - change (mediawiki...SecureHTML)
Fo0bar has submitted this change and it was merged. Change subject: Convert to 1.25+ extension.json .. Convert to 1.25+ extension.json Backwards compatible with 1.23. Change-Id: I15a312662917ddb9c9743fd129e3737f4973cfd6 --- M README A SecureHTML.hooks.php D SecureHTML.i18n.php M SecureHTML.php A extension.json 5 files changed, 124 insertions(+), 115 deletions(-) Approvals: Fo0bar: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/README b/README index d8ac7d2..3296c90 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Secure HTML -Copyright (C) 2012 Ryan Finnie +Copyright (C) 2012-2016 Ryan Finnie Lets you include arbitrary HTML in an authorized and secure way http://www.mediawiki.org/wiki/Extension:Secure_HTML diff --git a/SecureHTML.hooks.php b/SecureHTML.hooks.php new file mode 100644 index 000..762e383 --- /dev/null +++ b/SecureHTML.hooks.php @@ -0,0 +1,62 @@ +setHook( $wgSecureHTMLTag, array( __CLASS__, 'secureHTMLRender' ) ); + } + + function secureHTMLRender( $input, $argv, $parser, $frame ) { + global $wgSecureHTMLSecrets; + + # The hash attribute is required. + if ( !isset( $argv['hash'] ) ) { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-hashrequired' ) ) ); + } + + # If the array is empty, there is no possible way this will work. + if ( count( $wgSecureHTMLSecrets ) === 0 ) { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-nokeys' ) ) ); + } + + # Get a list of key names. + $keynames = array_keys( $wgSecureHTMLSecrets ); + + # If the desired key name is not available, assume the first one. + $keyname = ( isset( $argv['keyname'] ) ? $argv['keyname'] : $keynames[0] ); + + # Key secret configuration. + $keyalgorithm = 'sha256'; + if ( !array_key_exists( $keyname, $wgSecureHTMLSecrets ) ) { + # To avoid leaking the existence of a key name by unauthorized users, + # perform a dummy HMAC SHA256 (mitigate timing attacks), then + # respond with "invalid hash", instead of something like "invalid key + # name". + $testhash = hash_hmac( 'sha256', $input, '' ); + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); + } + if ( is_array( $wgSecureHTMLSecrets[$keyname] ) ) { + if ( array_key_exists( 'secret', $wgSecureHTMLSecrets[$keyname] ) ) { + $keysecret = $wgSecureHTMLSecrets[$keyname]['secret']; + } else { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); + } + if ( array_key_exists( 'algorithm', $wgSecureHTMLSecrets[$keyname] ) ) { + $keyalgorithm = $wgSecureHTMLSecrets[$keyname]['algorithm']; + } + } else { + $keysecret = $wgSecureHTMLSecrets[$keyname]; + } + + # Compute a test hash. + $testhash = hash_hmac( $keyalgorithm, $input, $keysecret ); + + # If the test hash matches the supplied hash, return the raw HTML. Otherwise, error. + if ( $testhash === $argv['hash'] ) { + return( array( $input, 'markerType' => 'nowiki' ) ); + } else { + return( Html::rawElement( 'div', array( 'class' => 'error' ), wfMessage( 'securehtml-invalidhash' ) ) ); + } + } + +} diff --git a/SecureHTML.i18n.php b/SecureHTML.i18n.php deleted file mode 100644 index 7d6faac..000 --- a/SecureHTML.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim2c9b1ded6737f38f' ) ) { - function wfJsonI18nShim2c9b1ded6737f38f( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { -
[MediaWiki-commits] [Gerrit] [WIP] Some decoupling of GatewayPage from GatewayType - change (mediawiki...DonationInterface)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/300804 Change subject: [WIP] Some decoupling of GatewayPage from GatewayType .. [WIP] Some decoupling of GatewayPage from GatewayType GatewayType is no longer responsible for the HTTP context or request. Bug: T131798 Bug: T131275 Change-Id: Iae8d4499ee73ce521985ba9277e93457b5b924df --- M gateway_common/GatewayPage.php M gateway_common/GatewayType.php M gateway_common/gateway.adapter.php M gateway_forms/Form.php M gateway_forms/Mustache.php 5 files changed, 27 insertions(+), 40 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/04/300804/1 diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index b99f253..66ef22e 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -160,7 +160,9 @@ $form_class = $this->adapter->getFormClass(); // TODO: use interface. static ctor. if ( $form_class && class_exists( $form_class ) ){ - $form_obj = new $form_class( $this->adapter ); + $form_obj = new $form_class(); + $form_obj->setGateway( $this->adapter ); + $form_obj->setGatewayPage( $this ); $form = $form_obj->getForm(); $output->addModules( $form_obj->getResources() ); $output->addModuleStyles( $form_obj->getStyleModules() ); diff --git a/gateway_common/GatewayType.php b/gateway_common/GatewayType.php index 24a758a..7ebe8a9 100644 --- a/gateway_common/GatewayType.php +++ b/gateway_common/GatewayType.php @@ -283,13 +283,6 @@ public function setRiskScore( $score ); /** -* Get the current HTTP request -* -* @return WebRequest -*/ - public function getRequest(); - - /** * Returns the current validation action. * This will typically get set and altered by the various enabled process hooks. * diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index 5355011..42b6ded 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -178,12 +178,6 @@ protected $api_request = false; /** -* The current HTTP request context -* @var IContextSource -*/ - protected $context; - - /** * The current HTTP request * @var WebRequest */ @@ -227,8 +221,6 @@ * @see DonationData */ public function __construct( $options = array() ) { - $this->context = RequestContext::getMain(); - $this->request = $this->context->getRequest(); $defaults = array( 'external_data' => null, @@ -261,7 +253,9 @@ $this->defineDataTransformers(); - $this->session_resetOnSwitch(); // Need to do this before creating DonationData + if ( !$this->isBatchProcessor() ) { + $this->session_resetOnSwitch(); // Need to do this before creating DonationData + } // FIXME: this should not have side effects like setting order_id_meta['final'] $this->dataObj = new DonationData( $this, $options['external_data'] ); @@ -292,18 +286,6 @@ ) ); $this->addManualError( $error ); } - } - - /** -* Get the currency HTTP request context -* @return IContextSource -*/ - public function getContext() { - return $this->context; - } - - public function getRequest() { - return $this->request; } /** diff --git a/gateway_forms/Form.php b/gateway_forms/Form.php index d088c2c..557bc44 100644 --- a/gateway_forms/Form.php +++ b/gateway_forms/Form.php @@ -19,6 +19,11 @@ protected $gateway; /** +* @var GatewayPage +*/ + protected $gatewayPage; + + /** * @var string */ protected $scriptPath; @@ -34,10 +39,13 @@ */ abstract function getForm(); - public function __construct( $gateway ) { + /** +* Get these objects using "new" with no parameters. +*/ + public function __construct() {} + public function setGateway( GatewayType $gateway ) { $this->gateway = $gateway; - $this->scriptPath = $this->gateway->getContext()->getConfig()->get( 'ScriptPath' ); $this->logger = DonationLoggerFactory::getLogger( $gateway ); $gateway_errors = $this->gateway->getAllErrors(); @@ -50,11 +58,16 @@ $this->form_errors = array_merge( DataValidator::getEmptyErr
[MediaWiki-commits] [Gerrit] [WIP] WmfFramework-ization of some MediaWiki assumptions - change (mediawiki...DonationInterface)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/300805 Change subject: [WIP] WmfFramework-ization of some MediaWiki assumptions .. [WIP] WmfFramework-ization of some MediaWiki assumptions When this patch is ready, it should give us orphan rectification code paths from within Drupal. Bug: T131798 Bug: T131275 Change-Id: Ic9d4636cdb140b4778e8380f87334983a0f29ec8 --- M gateway_common/ContributionTrackingPlusUnique.php M gateway_common/DonationData.php M gateway_common/DonorLanguage.php A gateway_common/LogPrefixProvider.php M gateway_common/WmfFramework.drupal.php M gateway_common/WmfFramework.mediawiki.php M globalcollect_gateway/IngenicoLanguage.php M globalcollect_gateway/IngenicoReturntoHelper.php M globalcollect_gateway/orphan.adapter.php 9 files changed, 60 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/05/300805/1 diff --git a/gateway_common/ContributionTrackingPlusUnique.php b/gateway_common/ContributionTrackingPlusUnique.php index a445e86..f047461 100644 --- a/gateway_common/ContributionTrackingPlusUnique.php +++ b/gateway_common/ContributionTrackingPlusUnique.php @@ -6,6 +6,9 @@ */ class ContributionTrackingPlusUnique implements StagingHelper, UnstagingHelper { public function stage( GatewayType $adapter, $normalized, &$stagedData ) { + if ( !isset( $normalized['contribution_tracking_id'] ) ) { + return; + } $ctid = $normalized['contribution_tracking_id']; //append timestamp to ctid $ctid .= '.' . (( microtime( true ) * 1000 ) % 10); //least significant five diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php index 711fcd2..f5b57bf 100644 --- a/gateway_common/DonationData.php +++ b/gateway_common/DonationData.php @@ -126,6 +126,10 @@ */ protected function populateData( $external_data = false ) { $this->normalized = array(); + if ( $this->gateway->isBatchProcessor() && !$external_data ) { + // No harvesting to do if we're in batch mode. + return; + } if ( is_array( $external_data ) ) { //I don't care if you're a test or not. At all. $this->normalized = $external_data; @@ -160,12 +164,7 @@ * @return mixed The final value of the var, or null if we don't actually have it. */ protected function sourceHarvest( $var ) { - $ret = $this->gateway->getRequest()->getText( $var, null ); //all strings is just fine. - //getText never returns null: It just casts do an empty string. S... - if ( $ret === '' && !array_key_exists( $var, $_POST ) && !array_key_exists( $var, $_GET ) ) { - $ret = null; //not really there, so stop pretending. - } - + $ret = WmfFramework::getRequestValue( $var, null ); return $ret; } diff --git a/gateway_common/DonorLanguage.php b/gateway_common/DonorLanguage.php index a7aa8af..8051dd0 100644 --- a/gateway_common/DonorLanguage.php +++ b/gateway_common/DonorLanguage.php @@ -2,10 +2,13 @@ class DonorLanguage implements StagingHelper { public function stage( GatewayType $adapter, $normalized, &$stagedData ) { + if ( !isset( $normalized['language'] ) ) { + return; + } $language = $normalized['language']; $adapterLanguages = $adapter->getAvailableLanguages(); if ( !in_array( $language, $adapterLanguages ) ) { - $fallbacks = Language::getFallbacksFor( $language ); + $fallbacks = WmfFramework::getLanguageFallbacks( $language ); foreach ( $fallbacks as $fallback ) { if ( in_array( $fallback, $adapterLanguages ) ) { $language = $fallback; diff --git a/gateway_common/LogPrefixProvider.php b/gateway_common/LogPrefixProvider.php new file mode 100644 index 000..1a60433 --- /dev/null +++ b/gateway_common/LogPrefixProvider.php @@ -0,0 +1,5 @@ +getIP(); } + static function getRequestValue( $key, $default ) { + //all strings is just fine. + $ret = RequestContext::getMain()->getRequest()->getText( $key, $default ); + //getText never returns null: It just casts do an empty string. S... + if ( $ret === '' && !array_key_exists( $var, $_POST ) && !array_key_exists( $var, $_GET ) ) { + $ret = null; //not really there, so stop pretending. + } + return $ret; + } + static function ge
[MediaWiki-commits] [Gerrit] Gerrit: Run list_reviewer_counts cron as root - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: Gerrit: Run list_reviewer_counts cron as root .. Gerrit: Run list_reviewer_counts cron as root It doesn't need to be done by gerrit2 anymore, and doing so just risks it failing on permissions to /var/www Change-Id: I6fce9dbdb70943f25af430fc383c202039edacc5 --- M modules/gerrit/manifests/crons.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Paladox: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/gerrit/manifests/crons.pp b/modules/gerrit/manifests/crons.pp index 8dae376..be4a295 100644 --- a/modules/gerrit/manifests/crons.pp +++ b/modules/gerrit/manifests/crons.pp @@ -11,7 +11,7 @@ # This is useful information about the distribution of reviewers. # Gerrit's rest api doesn't provide an easy way to get this data. command => "/usr/bin/java -jar /var/lib/gerrit2/review_site/bin/gerrit.war gsql -d /var/lib/gerrit2/review_site/ --format JSON_SINGLE -c \"'SELECT changes.change_id AS change_id, COUNT(DISTINCT patch_set_approvals.account_id) AS reviewer_count FROM changes LEFT JOIN patch_set_approvals ON (changes.change_id = patch_set_approvals.change_id) GROUP BY changes.change_id'\" > /var/www/reviewer-counts.json", -user=> 'gerrit2', +user=> 'root', hour=> 1, } -- To view, visit https://gerrit.wikimedia.org/r/300711 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6fce9dbdb70943f25af430fc383c202039edacc5 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Faidon Liambotis Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove ytterbium from puppet, update gerrit comment - change (operations/puppet)
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/300806 Change subject: remove ytterbium from puppet, update gerrit comment .. remove ytterbium from puppet, update gerrit comment Change-Id: I5d7c02b65cc1798e8aab5d64428059c7e0a1cb52 --- M manifests/site.pp 1 file changed, 1 insertion(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/06/300806/1 diff --git a/manifests/site.pp b/manifests/site.pp index bd8a767..e456038 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1541,7 +1541,7 @@ # New https://www.mediawiki.org/wiki/Gerrit node 'lead.wikimedia.org' { -# Note: whenever moving Gerrit out of ytterbium, you will need +# Note: whenever moving Gerrit to another server you will need # to update the role::zuul::configuration variable 'gerrit_server' role gerrit::server @@ -2922,18 +2922,6 @@ role parsoid include standard include role::parsoid::transition_cleanup -} - -# https://www.mediawiki.org/wiki/Gerrit -node 'ytterbium.wikimedia.org' { -# Note: whenever moving Gerrit out of ytterbium, you will need -# to update the role::zuul::configuration variable 'gerrit_server' -role gerrit::server - -include gerrit::migration::source -include standard - -interface::add_ip6_mapped { 'main': } } # T138650 - tools for the security team -- To view, visit https://gerrit.wikimedia.org/r/300806 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d7c02b65cc1798e8aab5d64428059c7e0a1cb52 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Clean up array() in docs, Part I - change (mediawiki/core)
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/300807 Change subject: Clean up array() in docs, Part I .. Clean up array() in docs, Part I Change-Id: Ia6bb3944c05b056677979035cb38385554ee8a4f --- M includes/GlobalFunctions.php M includes/SiteConfiguration.php M includes/api/ApiBase.php M includes/api/ApiContinuationManager.php M includes/api/ApiMain.php M includes/api/ApiModuleManager.php M includes/api/ApiPageSet.php M includes/api/ApiQueryBase.php M includes/api/ApiQueryDuplicateFiles.php M includes/api/ApiQueryInfo.php M includes/api/ApiQueryRecentChanges.php M includes/api/ApiQuerySiteinfo.php M includes/api/ApiResult.php 13 files changed, 55 insertions(+), 56 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/300807/1 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 66e2440..0ff4dca 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -222,17 +222,17 @@ * Merge arrays in the style of getUserPermissionsErrors, with duplicate removal * e.g. * wfMergeErrorArrays( - * array( array( 'x' ) ), - * array( array( 'x', '2' ) ), - * array( array( 'x' ) ), - * array( array( 'y' ) ) + * [ [ 'x' ] ], + * [ [ 'x', '2' ] ], + * [ [ 'x' ] ], + * [ [ 'y' ] ] * ); * returns: - * array( - * array( 'x', '2' ), - * array( 'x' ), - * array( 'y' ) - * ) + * [ + * [ 'x', '2' ], + * [ 'x' ], + * [ 'y' ] + * ] * * @param array $array1,... * @return array @@ -827,7 +827,7 @@ $bits = parse_url( $url ); MediaWiki\restoreWarnings(); // parse_url() returns an array without scheme for some invalid URLs, e.g. - // parse_url("%0Ahttp://example.com";) == array( 'host' => '%0Ahttp', 'path' => 'example.com' ) + // parse_url("%0Ahttp://example.com";) == [ 'host' => '%0Ahttp', 'path' => 'example.com' ] if ( !$bits || !isset( $bits['scheme'] ) ) { return false; } diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 5b9bdfa..ffeb44d 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -36,15 +36,15 @@ * * @code * $conf = new SiteConfiguration; - * $conf->wikis = array( 'de', 'en', 'beta' ); + * $conf->wikis = [ 'de', 'en', 'beta' ]; * @endcode * * When configuring the MediaWiki global settings (the $wg variables), * the identifiers will be available to specify settings on a per wiki basis. * * @code - * $conf->settings = array( - * 'wgSomeSetting' => array( + * $conf->settings = [ + * 'wgSomeSetting' => [ * * # production: * 'de' => false, @@ -52,8 +52,8 @@ * * # test: * 'beta=> true, - * ), - * ); + * ], + * ]; * @endcode * * With three wikis, that is easy to manage. But what about a farm with @@ -62,15 +62,15 @@ * the above code could be written: * * @code - * $conf->settings = array( - * 'wgSomeSetting' => array( + * $conf->settings = [ + * 'wgSomeSetting' => [ * * 'default' => false, * * # Enable feature on test * 'beta'=> true, - * ), - * ); + * ], + * ]; * @endcode * * @@ -80,23 +80,23 @@ * on a per wiki basis. * * @code - * $conf->settings = array( - * 'wgMergeSetting' = array( + * $conf->settings = [ + * 'wgMergeSetting' = [ * # Value that will be shared among all wikis: - * 'default' => array( NS_USER => true ), + * 'default' => [ NS_USER => true ], * * # Leading '+' means merging the array of value with the defaults - * '+beta' => array( NS_HELP => true ), - * ), - * ); + * '+beta' => [ NS_HELP => true ], + * ], + * ]; * * # Get configuration for the German site: * $conf->get( 'wgMergeSetting', 'de' ); - * // --> array( NS_USER => true ); + * // --> [ NS_USER => true ]; * * # Get configuration for the testing site: * $conf->get( 'wgMergeSetting', 'beta' ); - * // --> array( NS_USER => true, NS_HELP => true ); + * // --> [ NS_USER => true, NS_HELP => true ]; * @endcode * * Finally, to load all configuration settings, extract them in global context: @@ -110,7 +110,7 @@ * * @todo Give examples for, * suffixes: - * $conf->suffixes = array( 'wiki' ); + * $conf->suffixes = [ 'wiki' ]; * localVHosts * callbacks! */ diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 3e57e89..b45eacb 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -2144,7 +2144,7 @@ /** * Return the error message related to a certain array * @par
[MediaWiki-commits] [Gerrit] Gerrit: Swap lead to point at production data - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: Gerrit: Swap lead to point at production data .. Gerrit: Swap lead to point at production data - Points at proper hostname and database for lead - Enable replication from lead - Stops replication from ytterbium - switches zuul config from ytterbium to lead Change-Id: I312d405ce964a5b18d5f58815232fd25d5e02c14 --- M hieradata/hosts/lead.yaml M hieradata/hosts/ytterbium.yaml M hieradata/role/common/gerrit/server.yaml M modules/role/manifests/zuul/configuration.pp 4 files changed, 3 insertions(+), 4 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/hieradata/hosts/lead.yaml b/hieradata/hosts/lead.yaml index 0b94583..58f371f 100644 --- a/hieradata/hosts/lead.yaml +++ b/hieradata/hosts/lead.yaml @@ -1,5 +1,2 @@ -gerrit::host: 'gerrit-new.wikimedia.org' -gerrit::jetty::db_host: 'db1042.eqiad.wmnet' -gerrit::jetty::replication: '' role::gerrit::server::ipv4: '208.80.154.85' role::gerrit::server::ipv6: '2620:0:861:3:208:80:154:85' diff --git a/hieradata/hosts/ytterbium.yaml b/hieradata/hosts/ytterbium.yaml index 2c7062b..b3718c7 100644 --- a/hieradata/hosts/ytterbium.yaml +++ b/hieradata/hosts/ytterbium.yaml @@ -9,3 +9,4 @@ gerrit::jetty::git_dir: '/var/lib/gerrit2/review_site/git' gerrit::jetty::index_type: 'SQL' gerrit::proxy::lets_encrypt: false +gerrit::jetty::replication: '' diff --git a/hieradata/role/common/gerrit/server.yaml b/hieradata/role/common/gerrit/server.yaml index 1add1c4..c819391 100644 --- a/hieradata/role/common/gerrit/server.yaml +++ b/hieradata/role/common/gerrit/server.yaml @@ -19,3 +19,4 @@ - '+refs/heads/*:refs/heads/*' - '+refs/tags/*:refs/tags/*' role::gerrit::server::bacula: 'srv-gerrit-git' +gerrit::proxy::maint_mode: '04:00 UTC' diff --git a/modules/role/manifests/zuul/configuration.pp b/modules/role/manifests/zuul/configuration.pp index cf7435c..dbb8445 100644 --- a/modules/role/manifests/zuul/configuration.pp +++ b/modules/role/manifests/zuul/configuration.pp @@ -5,7 +5,7 @@ $shared = { 'production' => { -'gerrit_server' => 'ytterbium.wikimedia.org', +'gerrit_server' => 'lead.wikimedia.org', 'gerrit_user' => 'jenkins-bot', 'url_pattern' => 'https://integration.wikimedia.org/ci/job/{job.name}/{build.number}/console', 'status_url' => 'https://integration.wikimedia.org/zuul/', -- To view, visit https://gerrit.wikimedia.org/r/298673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I312d405ce964a5b18d5f58815232fd25d5e02c14 Gerrit-PatchSet: 8 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Hashar Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Gerrit: Swap DNS to new host, lead - change (operations/dns)
Dzahn has submitted this change and it was merged. Change subject: Gerrit: Swap DNS to new host, lead .. Gerrit: Swap DNS to new host, lead Change-Id: I71e32568343d4ebe7fc75d4d44469e403b9e5117 --- M templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa M templates/154.80.208.in-addr.arpa M templates/wikimedia.org 3 files changed, 3 insertions(+), 7 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa index 94f53b1..8914ffb 100644 --- a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa +++ b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa @@ -71,9 +71,8 @@ 3.9.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR radon.wikimedia.org. 4.7.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR fermium.wikimedia.org. 6.7.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR mx1001.wikimedia.org. -1.8.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR gerrit.wikimedia.org. 3.8.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR install1001.wikimedia.org. -5.8.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR gerrit-new.wikimedia.org. +5.8.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR gerrit.wikimedia.org. ; public1-d-eqiad (2620:0:861:4::/64) $ORIGIN 4.0.0.0.{{ zonename }}. diff --git a/templates/154.80.208.in-addr.arpa b/templates/154.80.208.in-addr.arpa index a8b004b..3c7121b 100644 --- a/templates/154.80.208.in-addr.arpa +++ b/templates/154.80.208.in-addr.arpa @@ -66,11 +66,10 @@ 78 1H IN PTR vl1003-eth2.lvs1001.wikimedia.org. 79 1H IN PTR seaborgium.wikimedia.org. ; VM on the ganeti01.svc.eqiad.wmnet cluster 80 1H IN PTR ytterbium.wikimedia.org. -81 1H IN PTR gerrit.wikimedia.org. 82 1H IN PTR lead.wikimedia.org. 83 1H IN PTR install1001.wikimedia.org. ; VM on the ganeti01.svc.eqiad.wmnet cluster 84 1H IN PTR ununpentium.wikimedia.org. ; VM on the ganeti01.svc.eqiad.wmnet cluster -85 1H IN PTR gerrit-new.wikimedia.org. +85 1H IN PTR gerrit.wikimedia.org. 91 1H IN PTR wiki-mail-eqiad.wikimedia.org. 92 1H IN PTR labcontrol1001.wikimedia.org. 93 1H IN PTR radon.wikimedia.org. diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 5ce9257..8871581 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -470,9 +470,7 @@ frdata 1H IN CNAMEfrdata-eqiad -gerrit 600 IN A208.80.154.81 -600 IN 2620:0:861:3:208:80:154:81 -gerrit-new 600 IN A208.80.154.85 +gerrit 600 IN A208.80.154.85 600 IN 2620:0:861:3:208:80:154:85 git 600 IN DYNA geoip!misc-addrs graphite600 IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/299007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I71e32568343d4ebe7fc75d4d44469e403b9e5117 Gerrit-PatchSet: 3 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change in operations/puppet[production]: Gerrit: Minor tweak to change subject... "Change In" is redu...
Chad has uploaded a new change for review. https://gerrit.wikimedia.org/r/300814 Change subject: Gerrit: Minor tweak to change subject... "Change In" is redundant .. Gerrit: Minor tweak to change subject... "Change In" is redundant Change-Id: I672e9db4cdaade0d4fe36a3bba784e3a7fbfb8ed --- M modules/gerrit/files/etc/mail/ChangeSubject.vm 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/14/300814/1 diff --git a/modules/gerrit/files/etc/mail/ChangeSubject.vm b/modules/gerrit/files/etc/mail/ChangeSubject.vm index 7879c23..d8a576a 100644 --- a/modules/gerrit/files/etc/mail/ChangeSubject.vm +++ b/modules/gerrit/files/etc/mail/ChangeSubject.vm @@ -39,4 +39,4 @@ #macro(ellipsis $length $str) #if($str.length() > $length)#set($length = $length - 3)${str.substring(0,$length)}...#else$str#end #end -[Gerrit] Change in ${projectName.replaceAll('/.*/', '...')}[$branch.shortName]: #ellipsis(63, $change.subject) +[Gerrit] ${projectName.replaceAll('/.*/', '...')}[$branch.shortName]: #ellipsis(63, $change.subject) -- To view, visit https://gerrit.wikimedia.org/r/300814 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I672e9db4cdaade0d4fe36a3bba784e3a7fbfb8ed Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change in operations/puppet[production]: Gerrit: Minor tweak to change subject... "Change In" is redu...
Dzahn has submitted this change and it was merged. Change subject: Gerrit: Minor tweak to change subject... "Change In" is redundant .. Gerrit: Minor tweak to change subject... "Change In" is redundant Change-Id: I672e9db4cdaade0d4fe36a3bba784e3a7fbfb8ed --- M modules/gerrit/files/etc/mail/ChangeSubject.vm 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/gerrit/files/etc/mail/ChangeSubject.vm b/modules/gerrit/files/etc/mail/ChangeSubject.vm index 7879c23..d8a576a 100644 --- a/modules/gerrit/files/etc/mail/ChangeSubject.vm +++ b/modules/gerrit/files/etc/mail/ChangeSubject.vm @@ -39,4 +39,4 @@ #macro(ellipsis $length $str) #if($str.length() > $length)#set($length = $length - 3)${str.substring(0,$length)}...#else$str#end #end -[Gerrit] Change in ${projectName.replaceAll('/.*/', '...')}[$branch.shortName]: #ellipsis(63, $change.subject) +[Gerrit] ${projectName.replaceAll('/.*/', '...')}[$branch.shortName]: #ellipsis(63, $change.subject) -- To view, visit https://gerrit.wikimedia.org/r/300814 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I672e9db4cdaade0d4fe36a3bba784e3a7fbfb8ed Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: TESTING STUFF
Chad has uploaded a new change for review. https://gerrit.wikimedia.org/r/300815 Change subject: TESTING STUFF .. TESTING STUFF Bug: T70271 Change-Id: I122e1fc830ad967eb7a1bd486cc236fdc866927c --- D README 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/15/300815/1 diff --git a/README b/README deleted file mode 100644 index e2836eb..000 --- a/README +++ /dev/null @@ -1,15 +0,0 @@ -The Wikimedia Foundation operates some of the largest collaboratively edited -reference projects in the world, including Wikipedia. Our infrastructure powers -some of the most highly-trafficked sites on the web, serving content in over a -hundred languages to more than half a billion people each month. We use Puppet -to manage our server configuration. This is our Puppet repository. - -For an overview of how we use Puppet, and a review of the code conventions and -patterns that apply to this repository, see: -https://wikitech.wikimedia.org/wiki/Puppet_coding - -The code in this repository is authored and maintained by Wikimedia engineers -and a vibrant community of volunteer contributors. Get involved! - -https://wikitech.wikimedia.org/wiki/Get_involved -freenode: #wikimedia-operations -- To view, visit https://gerrit.wikimedia.org/r/300815 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I122e1fc830ad967eb7a1bd486cc236fdc866927c Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CheckUser[master]: Allow customizing user links in get user CheckUser results
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/300816 Change subject: Allow customizing user links in get user CheckUser results .. Allow customizing user links in get user CheckUser results Added 'checkuser-userlinks-ip' and 'checkuser-userlinks' messages which can be used for customizing the tool links on wiki. Bug: T49505 Change-Id: I4ceed2aeb5453da330253325b880fb77baa0c8d7 --- M i18n/en.json M i18n/qqq.json M specials/SpecialCheckUser.php 3 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser refs/changes/16/300816/1 diff --git a/i18n/en.json b/i18n/en.json index 783dfa8..2dcc128 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -81,6 +81,8 @@ "checkuser-create-action": "was created", "checkuser-email-action": "sent an email to user \"$1\"", "checkuser-reset-action": "reset password for user \"$1\"", + "checkuser-userlinks-ip": "([[User_talk:$1|talk]] | [[Special:Contributions/$1|contribs]] | [[Special:Block/$1|block]] | [https://www.robtex.com/whois/$1.html WHOIS/RDNS])", + "checkuser-userlinks": "([[User_talk:$1|talk]] | [[Special:Contributions/$1|contribs]] | [[Special:Block/$1|block]])", "checkuser-toollinks": "[[https://www.robtex.com/whois/$1.html WHOIS/RDNS] ·\n[https://www.robtex.com/rbls/$1.html RBLs] ·\n[http://www.dnsstuff.com/tools/tracert.ch?ip=$1 Traceroute] ·\n[https://www.ip2location.com/$1 Geolocate] ·\n[https://www.dan.me.uk/torcheck?ip=$1 Tor check]]", "checkuser-token-fail": "Session failure. Please try again.", "group-checkuser.css": "/* CSS placed here will affect checkuser only */", diff --git a/i18n/qqq.json b/i18n/qqq.json index 505f406..a0e24ce 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -100,6 +100,8 @@ "checkuser-create-action": "Text of the event displayed in the CheckUser results. Indicates creation of the user.", "checkuser-email-action": "Logged text when a user sends an e-mail. Probably preceded by the name of the checkuser.\n\nParameters:\n* $1 - a salted MD5 hash for the user an email was sent to", "checkuser-reset-action": "Logged text when a user resets a password. Parameters:\n* $1 - the username for which the password was reset. Can be used for GENDER.", + "checkuser-userlinks-ip": "Links shown next to an IP address in a CheckUser result entry. $1 - IP address", + "checkuser-userlinks": "Links shown next to a user in a CheckUser result entry. $1 - Name of user", "checkuser-toollinks": "{{notranslate}}\nParameters:\n* $1 - IP address", "checkuser-token-fail": "Error message shown when the CSRF token does not match the current session.", "group-checkuser.css": "{{doc-group|checkuser|css}}", diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php index be2adb7..e286364 100644 --- a/specials/SpecialCheckUser.php +++ b/specials/SpecialCheckUser.php @@ -1064,8 +1064,11 @@ $s .= Xml::check( 'users[]', false, array( 'value' => $name ) ) . ' '; // Load user object $user = User::newFromName( $name, false ); - // Add user tool links - $s .= Linker::userLink( -1, $name ) . Linker::userToolLinks( -1, $name ); + // Add user page and tool links + $s .= Linker::userLink( -1, $name ) . ' '; + $ip = IP::isIPAddress( $name ) ? $name : ''; + $linksMsgKey = $ip ? 'checkuser-userlinks-ip' : 'checkuser-userlinks'; + $s .= $this->msg( $linksMsgKey, $name )->parse(); // Add CheckUser link $s .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getSelfLink( @@ -1082,7 +1085,6 @@ // @todo FIXME: i18n issue: Hard coded brackets. $s .= ' [' . $count . ']'; // Check if this user or IP is blocked. If so, give a link to the block log... - $ip = IP::isIPAddress( $name ) ? $name : ''; $flags = $this->userBlockFlags( $ip, $users_ids[$name], $user ); // Check how many accounts the user made recently if ( $ip ) { -- To view, visit https://gerrit.wikimedia.org/r/300816 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ceed2aeb5453da330253325b880fb77baa0c8d7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CheckUser Gerrit-Branch: master Gerrit-Owner: Glaisher ___
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add callable doc comments for WANObjectCache
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/300817 Change subject: Add callable doc comments for WANObjectCache .. Add callable doc comments for WANObjectCache Change-Id: I28a705ae12e065dc8a3921e33c873f9a7fbb7490 --- M includes/libs/objectcache/WANObjectCache.php 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/17/300817/1 diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 2dc17bf..fd916fe 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -759,7 +759,7 @@ * @param array $opts Options map: * - checkKeys: List of "check" keys. The key at $key will be seen as invalid when either * touchCheckKey() or resetCheckKey() is called on any of these keys. -* Default: []; +* Default: []. * - lowTTL: Consider pre-emptive updates when the current TTL (sec) of the key is less than * this. It becomes more likely over time, becoming a certainty once the key is expired. * Default: WANObjectCache::LOW_TTL seconds. @@ -788,6 +788,7 @@ * however, as this reduces compatibility (due to serialization). * Default: null. * @return mixed Value found or written to the key +* @note Callable type hints are not used to avoid class-autoloading */ final public function getWithSetCallback( $key, $ttl, $callback, array $opts = [] ) { $pcTTL = isset( $opts['pcTTL'] ) ? $opts['pcTTL'] : self::TTL_UNCACHEABLE; @@ -862,6 +863,7 @@ * - minTime: Treat values older than this UNIX timestamp as not existing. Default: null. * @param float &$asOf Cache generation timestamp of returned value [returned] * @return mixed +* @note Callable type hints are not used to avoid class-autoloading */ protected function doGetWithSetCallback( $key, $ttl, $callback, array $opts, &$asOf = null ) { $lowTTL = isset( $opts['lowTTL'] ) ? $opts['lowTTL'] : min( self::LOW_TTL, $ttl ); -- To view, visit https://gerrit.wikimedia.org/r/300817 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28a705ae12e065dc8a3921e33c873f9a7fbb7490 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert "Gerrit: Run list_reviewer_counts cron as root"
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/300818 Change subject: Revert "Gerrit: Run list_reviewer_counts cron as root" .. Revert "Gerrit: Run list_reviewer_counts cron as root" This reverts commit b4ae8235c49fa72c935cd741ef5c6f06b3b51baa. Change-Id: I3c927388f65524527c518edf17251db13f45d862 --- M modules/gerrit/manifests/crons.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/18/300818/1 diff --git a/modules/gerrit/manifests/crons.pp b/modules/gerrit/manifests/crons.pp index be4a295..8dae376 100644 --- a/modules/gerrit/manifests/crons.pp +++ b/modules/gerrit/manifests/crons.pp @@ -11,7 +11,7 @@ # This is useful information about the distribution of reviewers. # Gerrit's rest api doesn't provide an easy way to get this data. command => "/usr/bin/java -jar /var/lib/gerrit2/review_site/bin/gerrit.war gsql -d /var/lib/gerrit2/review_site/ --format JSON_SINGLE -c \"'SELECT changes.change_id AS change_id, COUNT(DISTINCT patch_set_approvals.account_id) AS reviewer_count FROM changes LEFT JOIN patch_set_approvals ON (changes.change_id = patch_set_approvals.change_id) GROUP BY changes.change_id'\" > /var/www/reviewer-counts.json", -user=> 'root', +user=> 'gerrit2', hour=> 1, } -- To view, visit https://gerrit.wikimedia.org/r/300818 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c927388f65524527c518edf17251db13f45d862 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Remove googlebot from banned IPs. They ain't so bad
Faidon Liambotis has submitted this change and it was merged. Change subject: Gerrit: Remove googlebot from banned IPs. They ain't so bad .. Gerrit: Remove googlebot from banned IPs. They ain't so bad Change-Id: Ic2d56189e81afb8314e8dac2e1d5809518ad7729 --- M modules/gerrit/templates/gerrit.wikimedia.org.erb 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Paladox: Looks good to me, but someone else must approve Faidon Liambotis: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/gerrit/templates/gerrit.wikimedia.org.erb b/modules/gerrit/templates/gerrit.wikimedia.org.erb index 34de6a7..0958527 100644 --- a/modules/gerrit/templates/gerrit.wikimedia.org.erb +++ b/modules/gerrit/templates/gerrit.wikimedia.org.erb @@ -70,7 +70,6 @@ SetEnvIf Remote_Addr 208.110.84.34 bad_browser SetEnvIf Remote_Addr 89.83.122.45 bad_browser SetEnvIf Remote_Addr 129.242.4.62 bad_browser -SetEnvIf Remote_Addr 66.249.64.129 bad_browser TimeOut 720 -- To view, visit https://gerrit.wikimedia.org/r/300692 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic2d56189e81afb8314e8dac2e1d5809518ad7729 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Faidon Liambotis Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: SpecialGlobalRenameProgress: show backlink subtitle when val...
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/300820 Change subject: SpecialGlobalRenameProgress: show backlink subtitle when valid username is specififed .. SpecialGlobalRenameProgress: show backlink subtitle when valid username is specififed Bug: T140458 Change-Id: I142f195c4db908c00d82ac2eda3f798a8694cd8f --- M includes/specials/SpecialGlobalRenameProgress.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/20/300820/1 diff --git a/includes/specials/SpecialGlobalRenameProgress.php b/includes/specials/SpecialGlobalRenameProgress.php index 2e0e88e..df0f4ce 100644 --- a/includes/specials/SpecialGlobalRenameProgress.php +++ b/includes/specials/SpecialGlobalRenameProgress.php @@ -101,7 +101,9 @@ $this->showCurrentRenames(); return false; } + $out = $this->getOutput(); + $out->addBacklinkSubtitle( $this->getPageTitle() ); $this->renameuserStatus = new GlobalRenameUserStatus( $name ); $names = $this->renameuserStatus->getNames(); -- To view, visit https://gerrit.wikimedia.org/r/300820 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I142f195c4db908c00d82ac2eda3f798a8694cd8f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Glaisher ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Make Special:GlobalRenameProgress work in read-only mode and...
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/300821 Change subject: Make Special:GlobalRenameProgress work in read-only mode and for blocked users .. Make Special:GlobalRenameProgress work in read-only mode and for blocked users Change-Id: I1be0a6381edc45140b18c6044a58c434520bc1d8 --- M includes/specials/SpecialGlobalRenameProgress.php 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/21/300821/1 diff --git a/includes/specials/SpecialGlobalRenameProgress.php b/includes/specials/SpecialGlobalRenameProgress.php index 2e0e88e..7c36ca2 100644 --- a/includes/specials/SpecialGlobalRenameProgress.php +++ b/includes/specials/SpecialGlobalRenameProgress.php @@ -155,4 +155,12 @@ $out->addHTML( $fieldset ); return true; } + + public function requiresWrite() { + return false; + } + + public function requiresUnblock() { + return false; + } } -- To view, visit https://gerrit.wikimedia.org/r/300821 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1be0a6381edc45140b18c6044a58c434520bc1d8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Glaisher ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Parse right description in Special:GlobalGroupPermissions
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/300824 Change subject: Parse right description in Special:GlobalGroupPermissions .. Parse right description in Special:GlobalGroupPermissions Regression from Ic003b91b7237c86ebca7befbe23a6516fee07fb6 Bug: T139491 Change-Id: I79662c9cd0e54469bfeb1d45725f2f777a667a56 --- M includes/specials/SpecialGlobalGroupPermissions.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/24/300824/1 diff --git a/includes/specials/SpecialGlobalGroupPermissions.php b/includes/specials/SpecialGlobalGroupPermissions.php index b002e7f..63e948f 100644 --- a/includes/specials/SpecialGlobalGroupPermissions.php +++ b/includes/specials/SpecialGlobalGroupPermissions.php @@ -357,8 +357,9 @@ * @return string escaped html */ protected function formatRight( $right ) { - return htmlspecialchars( User::getRightDescription( $right ) ). ' ' . + return $this->getOutput()->parseInline( User::getRightDescription( $right ) ) . ' ' . Html::element( 'code', array(), $this->msg( 'parentheses', $right )->text() ); + } /** -- To view, visit https://gerrit.wikimedia.org/r/300824 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79662c9cd0e54469bfeb1d45725f2f777a667a56 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Glaisher ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] translatewiki[master]: Add Magic file for SiteMatrix
jenkins-bot has submitted this change and it was merged. Change subject: Add Magic file for SiteMatrix .. Add Magic file for SiteMatrix Change-Id: Ib7fb9c7f329ad8e23264b16f3b9dce5a8d72f322 Depends-On: Iff3b59a2b491f6998cdb5836754e9f501ef44c64 --- M groups/MediaWiki/mediawiki-extensions.txt 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index e9c25aa..e09fbbb 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -2168,6 +2168,7 @@ Site Matrix aliasfile = SiteMatrix/SiteMatrix.alias.php +magicfile = SiteMatrix/SiteMatrix.i18n.magic.php Site Metrics -- To view, visit https://gerrit.wikimedia.org/r/300026 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7fb9c7f329ad8e23264b16f3b9dce5a8d72f322 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Reedy Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Cleanup old notification config
jenkins-bot has submitted this change and it was merged. Change subject: Cleanup old notification config .. Cleanup old notification config Bug: T121612 Change-Id: Idd56602e889f07b6fd54ef34314622e7052664e4 --- M ContentTranslation.hooks.php M i18n/en.json M i18n/qqq.json 3 files changed, 0 insertions(+), 16 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php index ba3124e..72cb5e6 100644 --- a/ContentTranslation.hooks.php +++ b/ContentTranslation.hooks.php @@ -272,8 +272,6 @@ 'group' => 'positive', 'section' => 'message', 'presentation-model' => 'ContentTranslation\\EchoNotificationPresentationModel', - 'title-message' => 'cx-notification-first-translation', - 'email-subject-message' => 'cx-notification-first-translation-email-subject', ]; $notifications['cx-tenth-translation'] = [ @@ -281,8 +279,6 @@ 'group' => 'positive', 'section' => 'message', 'presentation-model' => 'ContentTranslation\\EchoNotificationPresentationModel', - 'title-message' => 'cx-notification-tenth-translation', - 'email-subject-message' => 'cx-notification-tenth-translation-email-subject', ]; $notifications['cx-hundredth-translation'] = [ @@ -290,8 +286,6 @@ 'group' => 'positive', 'section' => 'message', 'presentation-model' => 'ContentTranslation\\EchoNotificationPresentationModel', - 'title-message' => 'cx-notification-hundredth-translation', - 'email-subject-message' => 'cx-notification-hundredth-translation-email-subject', ]; $notifications['cx-suggestions-available'] = [ @@ -299,8 +293,6 @@ 'group' => 'positive', 'section' => 'message', 'presentation-model' => 'ContentTranslation\\EchoNotificationPresentationModel', - 'title-message' => 'cx-notification-suggestions-available', - 'email-subject-message' => 'cx-notification-suggestions-available-email-subject', ]; $icons['cx'] = [ diff --git a/i18n/en.json b/i18n/en.json index 89ffd42..9b124fa 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -182,11 +182,8 @@ "echo-category-title-cx": "Translations", "echo-pref-tooltip-cx": "Notify me about my translations created using Content Translation tool.", "cx-notification-first-translation": "Congratulations on your first translation! Check your contributions and find more pages to translate.", - "cx-notification-first-translation-email-subject": "Congratulations for your first translation", "cx-notification-tenth-translation": "Congratulations for your tenth translation! You are becoming an expert translator. Keep up the good work!", - "cx-notification-tenth-translation-email-subject": "Congratulations for your tenth translation", "cx-notification-hundredth-translation": "You just made 100 translations! That is a remarkable achievement. Share the news with other editors.", - "cx-notification-hundredth-translation-email-subject": "Congratulations for your one hundredth translation", "cx-contributions-link": "Your contributions", "cx-your-translations-link": "{{GENDER:$1|Your translations}}", "cx-translationlist-empty-title": "Nothing to translate?", @@ -206,7 +203,6 @@ "cx-suggestionlist-collapse": "View less", "cx-suggestionlist-refresh": "Refresh suggestions", "cx-notification-suggestions-available": "Based on {{GENDER:$2|your}} previous translation of '''$1''', new suggestions are now available.", - "cx-notification-suggestions-available-email-subject": "Translation suggestions available", "cx-tools-linter-title": "Content issues: $1", "cx-tools-linter-content": "Content not meeting [//www.mediawiki.org/wiki/Content_translation/Abuse_filter the restrictions set by Wikipedia in $1] found. Please fix the issues before publishing the translation.", "cx-tools-linter-view-details": "View details", diff --git a/i18n/qqq.json b/i18n/qqq.json index 410b242..0a98b86 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -188,11 +188,8 @@ "echo-category-title-cx": "Title of CX Echo notifications. Shown in [[Special:Preferences]] page to configure notifications\n{{related|Echo-category-title}}\n{{Identical|Translation}}", "echo-pref-tooltip-cx": "A tooltip text about CX notifcations.Shown in [[Special:Prefe
[MediaWiki-commits] [Gerrit] translatewiki[master]: Add RevisionSlider to extensions used by Wikimedia
jenkins-bot has submitted this change and it was merged. Change subject: Add RevisionSlider to extensions used by Wikimedia .. Add RevisionSlider to extensions used by Wikimedia It's on the way to deployment as a beta feature in the German Wikipedia, see bug T140232, and there is a discussion about enabling it in the Hebrew Wikipedia as well. Change-Id: I93af96bb080f20621e200bb75cd3912c9b9289f4 --- M groups/MediaWiki/WikimediaAgg.yaml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/MediaWiki/WikimediaAgg.yaml b/groups/MediaWiki/WikimediaAgg.yaml index 85e1df0..6aba9f5 100644 --- a/groups/MediaWiki/WikimediaAgg.yaml +++ b/groups/MediaWiki/WikimediaAgg.yaml @@ -93,6 +93,7 @@ - ext-relatedsites # Change id bc3616c74aab74b74f78bbb2ce3241e5a564b4f9 for Wikivoyage - ext-renameuser # Being phased out, 2015 - ext-restbaseupdatejobs # 2015-03-09 + - ext-revisionslider - ext-rss # 2010-11-25: Wikimediafoundation.org - ext-sandboxlink - ext-score -- To view, visit https://gerrit.wikimedia.org/r/299276 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93af96bb080f20621e200bb75cd3912c9b9289f4 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Amire80 Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits