From 21aa6880643331de0046fdda5d598194f4436d30 Mon Sep 17 00:00:00 2001
From: Stein Magne Bjorklund <steinmb@smbjorklund.com>
Date: Sat, 11 Oct 2014 16:11:13 +0200
Subject: [PATCH] Issue 2333409 by steinmb: Prevent https getting blocked in
 mixed mode.

---
 README.txt                        | 14 ++++++--------
 media_flickr.module               |  4 ++--
 providers/emimage/flickr.inc      |  8 ++++----
 providers/emvideo/flickr_sets.inc |  8 ++++----
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/README.txt b/README.txt
index 2285c01..6ee3ff1 100644
--- a/README.txt
+++ b/README.txt
@@ -1,17 +1,15 @@
 
-Readme for Media: Flicker
+Readme for Media: Flickr
 
 The Media: Flickr project currently offers Flickr Photoset capabilities to the
-Embedded Media Field module, available at http://drupal.org/project/emfield.
+Embedded Media Field module, available at https://drupal.org/project/emfield.
 To use it, enable the Embedded Video Field module, and add a Third Party Video
 field to a content type. For Thumbnails, you'll also need to apply for a Flickr
-API key, from http://www.flickr.com/services/api/keys.
+API key, from https://www.flickr.com/services/api/keys.
 
 After that, editors will be able to paste a URL or the embed code for a Flickr
 Photoset or Slideshow into the field, and it will be displayed automatically.
-Additionally, that URL will be parsed automatically, so the module will know the
-difference between a Flickr Photoset URL and another supported provider, such as
-a YouTube video.
+Additionally, that URL will be parsed automatically, so the module will know the difference between a Flickr Photoset URL and another supported provider, such as a YouTube video.
 
 
 Configuration:
@@ -31,8 +29,8 @@ Content Creation:
 ----------------
 (3) If you want a single image from Flickr, then use the "Embedded Image" CCK
 field.
-Example Flickr URL: http://www.flickr.com/photos/thusthought/5156938698/in/set-72157625220814125/
+Example Flickr URL: https://www.flickr.com/photos/thusthought/5156938698/in/set-72157625220814125/
 
 (4) If you want to use a set from Flickr, then use the  "Embedded Video" CCK
 field.
-Example Flickr URL: http://www.flickr.com/photos/thusthought/sets/72157625220814125/show/
+Example Flickr URL: https://www.flickr.com/photos/thusthought/sets/72157625220814125/show/
diff --git a/media_flickr.module b/media_flickr.module
index 019ed55..22e6c7d 100644
--- a/media_flickr.module
+++ b/media_flickr.module
@@ -1,8 +1,8 @@
 <?php
 
 define('MEDIA_FLICKR_RESTPOINT', 'https://api.flickr.com/services/rest/');
-define('MEDIA_FLICKR_API_APPLICATION_URL', 'http://www.flickr.com/services/api/keys');
-define('MEDIA_FLICKR_MAIN_URL', 'http://www.flickr.com/');
+define('MEDIA_FLICKR_API_APPLICATION_URL', 'https://www.flickr.com/services/api/keys');
+define('MEDIA_FLICKR_MAIN_URL', 'https://www.flickr.com/');
 
 /**
  *  @file
diff --git a/providers/emimage/flickr.inc b/providers/emimage/flickr.inc
index 5d65013..132546c 100644
--- a/providers/emimage/flickr.inc
+++ b/providers/emimage/flickr.inc
@@ -5,9 +5,9 @@
  * This include processes flickr.com image files for use by emfield.module.
  */
 
-define('EMIMAGE_FLICKR_MAIN_URL', 'http://www.flickr.com/');
-define('EMIMAGE_FLICKR_API_INFO', 'http://flickr.com/services/api');
-define('EMIMAGE_FLICKR_API_APPLICATION_URL', 'http://www.flickr.com/services/api/keys');
+define('EMIMAGE_FLICKR_MAIN_URL', 'https://www.flickr.com/');
+define('EMIMAGE_FLICKR_API_INFO', 'https://flickr.com/services/api');
+define('EMIMAGE_FLICKR_API_APPLICATION_URL', 'https://www.flickr.com/services/api/keys');
 define('EMIMAGE_FLICKR_REST_ENDPOINT', 'https://api.flickr.com/services/rest/');
 define('EMIMAGE_FLICKR_DATA_VERSION', 1);
 
@@ -207,7 +207,7 @@ function emimage_flickr_embedded_link($code, $data = array()) {
     $xml = emimage_flickr_request('flickr.photos.getInfo', array('photo_id' => $code));
     $owner = $xml['photo']['owner']['nsid'];
   }
-  return 'http://www.flickr.com/photos/'. $owner .'/'. $code;
+  return 'https://www.flickr.com/photos/'. $owner .'/'. $code;
 }
 
 /**
diff --git a/providers/emvideo/flickr_sets.inc b/providers/emvideo/flickr_sets.inc
index a71bfa7..739cf6c 100644
--- a/providers/emvideo/flickr_sets.inc
+++ b/providers/emvideo/flickr_sets.inc
@@ -48,7 +48,7 @@ function emvideo_flickr_sets_info() {
  */
 function emvideo_flickr_sets_settings() {
   if (!function_exists('emfield_imagerotator_url')) {
-    drupal_set_message(t('You should upgrade to a newer version of !emfield if you wish support for the !player or !imagerotator.', array('!emfield' => l(t('Embedded Media Field'), 'http://drupal.org/project/emfield'), '!player' => l(t('JW Flash Media Player'), 'http://www.longtailvideo.com/players/jw-flv-player/'), '!imagerotator' => l(t('JW Image Rotator'), 'http://www.longtailvideo.com/players/jw-image-rotator/'))), 'error');
+    drupal_set_message(t('You should upgrade to a newer version of !emfield if you wish support for the !player or !imagerotator.', array('!emfield' => l(t('Embedded Media Field'), 'https://drupal.org/project/emfield'), '!player' => l(t('JW Flash Media Player'), 'http://www.longtailvideo.com/players/jw-flv-player/'), '!imagerotator' => l(t('JW Image Rotator'), 'http://www.longtailvideo.com/players/jw-image-rotator/'))), 'error');
   }
   $form['flickr_sets']['media_flickr_store_local'] = array(
     '#type' => 'checkbox',
@@ -182,7 +182,7 @@ function emvideo_flickr_sets_embedded_link($video_code, $data = array()) {
   if (empty($data)) {
     $data = emvideo_flickr_sets_data(NULL, array('value' => $video_code));
   }
-  return 'http://www.flickr.com/photos/'. $data['owner'] .'/sets/'. $video_code;
+  return 'https://www.flickr.com/photos/'. $data['owner'] .'/sets/'. $video_code;
 }
 
 /**
@@ -194,8 +194,8 @@ function theme_emvideo_flickr_sets_flash($item, $width, $height, $autoplay, $opt
     $value = check_plain($item['value']);
     $embed = drupal_urlencode('photos/'. $item['data']['owner'] .'/sets/'. $value);
     $output = <<<EMBED
-<object type="application/x-shockwave-flash" data="http://www.flickr.com/apps/slideshow/show.swf?v=71649" width="$width" height="$height">
-  <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649" />
+<object type="application/x-shockwave-flash" data="https://www.flickr.com/apps/slideshow/show.swf?v=71649" width="$width" height="$height">
+  <param name="movie" value="https://www.flickr.com/apps/slideshow/show.swf?v=71649" />
   <param name="flashvars" value="offsite=true&amp;lang=en-us&amp;page_show_url=/$embed/show/&amp;page_show_back_url=/$embed&amp;set_id={$value}&amp;jump_to=" />
   <param name="allowFullScreen" value="true" />
 </object>
-- 
2.1.2

