The widgets.js file is being loaded over http://, which means a site under full SSL will generate browsers warnings about mixed content/insecure content when this resource is loaded.

This is trivially fixed by setting the url 'http://platform.twitter.com/widgets.js' to use relative protocol form: '//platform.twitter.com/widgets.js'.

This patch fixes this.

diff --git a/sites/all/modules/tweetbutton/tweetbutton.admin.inc b/sites/all/modules/tweetbutton/tweetbutton.admin.inc
index fc5540e..8f85280 100644
--- a/sites/all/modules/tweetbutton/tweetbutton.admin.inc
+++ b/sites/all/modules/tweetbutton/tweetbutton.admin.inc
@@ -89,7 +89,7 @@ function tweetbutton_admin_settings() {
     '#attached' => array(
       'js' => array(
   //       drupal_get_path('module', 'tweetbutton').'/tweetbutton.js',
-        'http://platform.twitter.com/widgets.js',
+        '//platform.twitter.com/widgets.js',
       ),
       'css' => array(drupal_get_path('module', 'tweetbutton').'/tweetbutton.css'),
     ),
diff --git a/sites/all/modules/tweetbutton/tweetbutton.module b/sites/all/modules/tweetbutton/tweetbutton.module
index 7f5a876..62387e9 100644
--- a/sites/all/modules/tweetbutton/tweetbutton.module
+++ b/sites/all/modules/tweetbutton/tweetbutton.module
@@ -84,7 +84,7 @@ function tweetbutton_node_view($node, $view_mode) {
     && in_array($view_mode, variable_get('tweetbutton_node_location', array('full')))
     && user_access('access tweetbutton')) {
     
-    drupal_add_js('http://platform.twitter.com/widgets.js'); 
+    drupal_add_js('//platform.twitter.com/widgets.js', 'external'); 
     drupal_add_css(drupal_get_path('module', 'tweetbutton').'/tweetbutton.css');
     
     // @todo: Add support for token replacements

Comments

timmillwood’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.