summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStein Magne Bjorklund2017-06-13 16:23:31 (GMT)
committerStein Magne Bjorklund2017-06-13 16:24:35 (GMT)
commit222a2a477ecbe47e66a09676223c2cd91e3e1461 (patch)
treea18385ac34d2b736325f34c7f65e7c0540b65d91
parent00e05f86dc862e77e754482168968752d772009a (diff)
Issue #2602558 by kovacsaba, herved, steinmb: Support Flickr albums7.x-1.x
Flickr renamed photosets (sets) to albums https://www.flickr.com/help/forum/en-us/72157644091018883 It also change the url from sets to albums though sets url still exists.
-rw-r--r--includes/media_flickr.utilities.inc13
1 files changed, 12 insertions, 1 deletions
diff --git a/includes/media_flickr.utilities.inc b/includes/media_flickr.utilities.inc
index 4b6923c..177e774 100644
--- a/includes/media_flickr.utilities.inc
+++ b/includes/media_flickr.utilities.inc
@@ -212,6 +212,16 @@ function _media_flickr_build_uri($parts) {
}
}
+/**
+ * Flickr media parse helper function. Search the original url for valid data.
+ *
+ * @param $url
+ * The original URL or embed code to parse.
+ * @param array $options
+ *
+ * @return string
+ * The unique URI for the file, based on its stream wrapper, or NULL.
+ */
function _media_flickr_media_parse($url, $options = array()) {
// The following are single images.
$patterns = array(
@@ -226,9 +236,10 @@ function _media_flickr_media_parse($url, $options = array()) {
return _media_flickr_build_uri(array('u' => $matches[1], 'p' => $matches[2]));
}
}
- // Next we look for photosets.
+ // Next we look for photosets/albums.
$patterns = array(
'@flickr\.com/photos/([0-9A-Za-z\@\&\$_-]+)/sets/([0-9]+)@i',
+ '@flickr\.com/photos/([0-9A-Za-z\@\&\$_-]+)/albums/([0-9]+)@i',
);
foreach ($patterns as $pattern) {
preg_match($pattern, $url, $matches);