Disable fetch for twitter and reddit when using SSL
authorMarcel Werk <burntime@woltlab.com>
Sat, 26 Apr 2014 12:57:03 +0000 (14:57 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 26 Apr 2014 12:57:03 +0000 (14:57 +0200)
wcfsetup/install/files/js/WCF.Message.js

index 8015ebe36b9e72a20941bddb228763eeabc555b5..0a6416cb43a10e3efd746a1ee0b9b945093984e7 100644 (file)
@@ -2962,6 +2962,8 @@ WCF.Message.Share.Page = Class.extend({
         * Fetches tweet count from Twitter.
         */
        _fetchTwitter: function() {
+               if (window.location.protocol.match(/^https/)) return;
+               
                this._fetchCount('http://urls.api.twitter.com/1/urls/count.json?url={pageURL}', $.proxy(function(data) {
                        if (data.count) {
                                this._ui.twitter.children('span.badge').show().text(data.count);
@@ -2973,6 +2975,8 @@ WCF.Message.Share.Page = Class.extend({
         * Fetches cumulative vote sum from Reddit.
         */
        _fetchReddit: function() {
+               if (window.location.protocol.match(/^https/)) return;
+               
                this._fetchCount('http://www.reddit.com/api/info.json?url={pageURL}', $.proxy(function(data) {
                        if (data.data.children.length) {
                                this._ui.reddit.children('span.badge').show().text(data.data.children[0].data.score);