To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 4535

Show
Ignore:
Timestamp:
02/02/12 10:12:58 (4 months ago)
Author:
tboutell
Message:

Hit #1219 viddler broke when they switched abruptly to clean URLs with video IDs in them. This is better in the long run (no API call just to figure out what the video ID is from the URL, no need to cache the result of that call) but it broke a lot of stuff

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/1.5/lib/embedService/aViddler.class.php

    r4063 r4535  
    162162    $info['credit'] = (string) $result['author']; 
    163163    $tags = array(); 
    164     foreach ($result['tags'] as $tag) 
    165     { 
    166       if ($tag['type'] === 'global') 
     164    if (isset($result['tags'])) 
     165    { 
     166      foreach ($result['tags'] as $tag) 
    167167      { 
    168         $tags[] = $tag['text']; 
     168        if ($tag['type'] === 'global') 
     169        { 
     170          $tags[] = $tag['text']; 
     171        } 
    169172      } 
    170173    } 
     
    205208  public function getIdFromUrl($url) 
    206209  { 
    207     // Viddler is atypical in that you cannot determine the id from the URL, 
     210    // Newfangled viddler URLs have ids in them 
     211    if (preg_match("/viddler.com\/v\/(\w+)$/", $url, $matches)) 
     212    { 
     213      $id = $matches[1]; 
     214      return $id; 
     215    } 
     216     
     217    // OLD STYLE: Viddler is atypical in that you cannot determine the id from the URL, 
    208218    // so let's ask them 
    209219    if (preg_match("/viddler.com\/explore\//", $url))