Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/272888
Change subject: Avoid unstubbing wgUser when an external survey is defined
......................................................................
Avoid unstubbing wgUser when an external survey is defined
Use content language to load the survey URL so that the user is
not loaded. This will break l10n of the survey URL (if that was
the intention) but retain wiki admins' ability to change it per-site.
If localization is needed, it should be reintroduced in a way
that is consistent with the ResourceLoader contract (no user-
dependency outside MakeGlobalVariablesScript).
Bug: T127870
Change-Id: Id1956d139a2c06d1e33d8a6d62d92b815a54a8fe
---
M includes/ExternalSurvey.php
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuickSurveys
refs/changes/88/272888/1
diff --git a/includes/ExternalSurvey.php b/includes/ExternalSurvey.php
index cea52a5..75d3d4e 100644
--- a/includes/ExternalSurvey.php
+++ b/includes/ExternalSurvey.php
@@ -14,7 +14,7 @@
private $name;
/**
- * @var string The URL of the external survey.
+ * @var string The key of the message containing the URL of the
external survey.
*/
private $link;
@@ -45,7 +45,8 @@
$this->link = $link;
$this->instanceTokenParameterName = $instanceTokenParameterName;
$this->privacyPolicy = $privacyPolicy;
- $this->isInsecure = !preg_match( '/https/i', wfMessage(
$this->link )->plain() ) ? true : false;
+ $linkIsHttps = (bool)preg_match( '/https/i', wfMessage(
$this->link )->inContentLanguage->plain() );
+ $this->isInsecure = $linkIsHttps ? false : true;
}
public function getMessages() {
--
To view, visit https://gerrit.wikimedia.org/r/272888
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1956d139a2c06d1e33d8a6d62d92b815a54a8fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuickSurveys
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits