summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStein Magne Bjorklund2017-06-13 16:23:31 (GMT)
committerStein Magne Bjorklund2017-06-13 16:23:31 (GMT)
commit886042d8af43a18c02837224b7ee97d774d8124b (patch)
tree5085bc1fd84c6ea85d3b1cdbec5eb42ceab99203
parent31142c281066bd9fa838161ad09ed4bafede0f6a (diff)
Issue #2602558 by kovacsaba, herved, steinmb: Support Flickr albums
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 1b90100..f133175 100644
--- a/includes/media_flickr.utilities.inc
+++ b/includes/media_flickr.utilities.inc
@@ -238,6 +238,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(
@@ -252,9 +262,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);