oembed: Better handling of unparsable oembed results (like youtube links
not allowed to embed).
This commit is contained in:
parent
7b05e0d26d
commit
d637d40d4e
|
@ -1,3 +1,7 @@
|
|||
Version 1.05 (brockhaus)
|
||||
-----------------------
|
||||
* Better handling of unparsable oembed results (like youtube links not allowed to embed).
|
||||
|
||||
Version 1.04 (brockhaus)
|
||||
-----------------------
|
||||
* added css for iframe videos contributed by Matthias Mees
|
||||
|
|
|
@ -76,13 +76,21 @@ class OEmbedProvider extends EmbedProvider{
|
|||
}
|
||||
}
|
||||
private function provideObject($url){
|
||||
$xml = null;
|
||||
if (!$this->onlyJson) {
|
||||
$xml=simplexml_load_string($this->provideXML($url));
|
||||
try {
|
||||
$xml=simplexml_load_string($this->provideXML($url));
|
||||
} catch (Exception $e) {
|
||||
// something went wrong.
|
||||
$xml = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (empty($xml)) {
|
||||
$data=$this->provide($url);
|
||||
if (!empty($data)) $xml = json_decode($data);
|
||||
}
|
||||
if (empty($xml)) return null;
|
||||
|
||||
//TODO $xml->type alapjan assigner
|
||||
$obj = $this->getTypeObj((string)$xml->type);
|
||||
$obj->cloneObj($xml);
|
||||
|
|
|
@ -30,7 +30,7 @@ class serendipity_event_oembed extends serendipity_event
|
|||
$propbag->add('description', PLUGIN_EVENT_OEMBED_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Grischa Brockhaus');
|
||||
$propbag->add('version', '1.04');
|
||||
$propbag->add('version', '1.05');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
|
Loading…
Reference in a new issue