Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245140

Change subject: Make HTTPS requirement configurable.
......................................................................

Make HTTPS requirement configurable.

Bug: T114485
Change-Id: Ib1e14d6291823b278bf9361046f06c8fc1b255c7
---
M extension.json
M includes/SurveyFactory.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuickSurveys 
refs/changes/40/245140/1

diff --git a/extension.json b/extension.json
index 9697146..d1afdf8 100644
--- a/extension.json
+++ b/extension.json
@@ -112,6 +112,7 @@
                ]
        },
        "config": {
+               "QuickSurveysRequireHttps": true,
                "QuickSurveysConfig": [
                        {
                                "@name": "survey name",
diff --git a/includes/SurveyFactory.php b/includes/SurveyFactory.php
index 6f04953..8a04ae3 100644
--- a/includes/SurveyFactory.php
+++ b/includes/SurveyFactory.php
@@ -61,13 +61,14 @@
        }
 
        private static function factoryExternal( $spec ) {
+               global $wgQuickSurveysRequireHttps;
                $name = $spec['name'];
 
                if ( !isset( $spec['link'] ) ) {
                        throw new InvalidArgumentException( "The \"{$name}\" 
external survey doesn't have a link." );
                }
 
-               if ( !preg_match( '/https/i', wfMessage( $spec['link'] ) ) ) {
+               if ( $wgQuickSurveysRequireHttps && !preg_match( '/https/i', 
wfMessage( $spec['link'] ) ) ) {
                        throw new InvalidArgumentException( "The \"{$name}\" 
external survey link requires https." );
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/245140
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1e14d6291823b278bf9361046f06c8fc1b255c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuickSurveys
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to