imgur: force https (2), fix comment

This commit is contained in:
Lorenz Hübschle-Schneider 2017-04-19 14:05:37 +02:00
parent 6d7de0c746
commit 8a230e9bf3
1 changed files with 3 additions and 3 deletions

View File

@ -281,8 +281,8 @@ plugins.factory('userPlugins', function() {
if (url.indexOf("^https?://fukung.net/v/") != -1) {
url = url.replace(/.*\//, "http://media.fukung.net/imgs/");
} else if (url.match(/^http:\/\/(i\.)?imgur\.com\//i)) {
// remove protocol specification to load over https if used by g-b
url = url.replace(/http:/, "https:");
// imgur: always use https. avoids mixed content warnings
url = url.replace(/^http:/, "https:");
} else if (url.match(/^https:\/\/www\.dropbox\.com\/s\/[a-z0-9]+\//i)) {
// Dropbox requires a get parameter, dl=1
var dbox_url = document.createElement("a");
@ -340,7 +340,7 @@ plugins.factory('userPlugins', function() {
var videoPlugin = new UrlPlugin('video', function(url) {
if (url.match(/\.(3gp|avi|flv|gifv|mkv|mp4|ogv|webm|wmv)\b/i)) {
if (url.match(/^http:\/\/(i\.)?imgur\.com\//i)) {
// imgur: force https
// imgur: always use https. avoids mixed content warnings
url = url.replace(/^http:/, "https:");
}
return function() {