Plugin Directory

Changeset 1962386


Ignore:
Timestamp:
10/24/2018 08:49:05 PM (7 years ago)
Author:
somatic
Message:

more media fetching fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • somatic-framework/trunk/inc/somaFunctions.php

    r1962362 r1962386  
    13351335        // in case user didn't include http
    13361336        if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
    1337             $url = "//" . $url;
    1338         }
     1337            $url = "https://" . $url;
     1338        }
     1339        // enforce https if user provided http
     1340        $url = str_replace('http://', 'https://', $url );
    13391341
    13401342        // identify which site
     
    13701372                    ob_end_clean();
    13711373                   
    1372                     $media['url']       = "//www.youtube.com/watch?v=$id";                                                                 // rebuild external url
     1374                    $media['url']       = "https://www.youtube.com/watch?v=$id";                                           // rebuild external url
    13731375                    $media['id']        = $id;
    13741376                    $media['site']      = $site;
    1375                     $media['thumb']     = $meta['thumbnail_url'];                                               // grabs url of medium 360x480 image
     1377                    $media['thumb']     = $meta['thumbnail_url'];                                                          // grabs url of medium 360x480 image
    13761378                    $media['title']     = $meta['title'];
    13771379                    // $media['desc']       = stripslashes($meta['media$group']['media$description']['$t']);
    13781380                    // $media['duration']   = $meta['media$group']['media$content'][0]['duration'];
    1379                     $media['mobile']    = "youtube:$id";                                                                                    // launches youtube app, i think...
     1381                    $media['mobile']    = "youtube:$id";                                                                  // launches youtube app, i think...
    13801382                    $media['embed']     = "<iframe width=\"$width\" height=\"$height\" src=\"//www.youtube.com/embed/$id?rel=0&hd=1\" frameborder=\"0\" allowfullscreen></iframe>";
    1381                     $media['iframe']    = "//www.youtube.com/embed/$id?rel=0&hd=1&autoplay=1";                                         // url to pass to iframe renderers
     1383                    $media['iframe']    = "//www.youtube.com/embed/$id?rel=0&hd=1&autoplay=1";                            // url to pass to iframe renderers
    13821384                    // $media['api']        = $meta;                                                                                            // we include everything we got from the site API, just in case (each site formats differently)
    13831385                } else {
     
    14001402                    $meta = array_shift(unserialize($meta));                            // get more metadata (note: we're making two distinct calls to API for vimeo)
    14011403                    $meta = array_merge($oembed, $meta);                                                                                    // combine the two (including some overlapping keys)
    1402                     $media['url']       = "//vimeo.com/$id";                                                                           // rebuild external url
     1404                    $media['url']       = "https://vimeo.com/$id";                                                                           // rebuild external url
    14031405                    $media['id']        = $id;                                                                                              // store raw media ID
    14041406                    $media['site']      = $site;                                                                                            //
Note: See TracChangeset for help on using the changeset viewer.