Merge remote-tracking branch 'upstream/nightly' into nightly
This commit is contained in:
commit
12cd0af111
|
@ -693,6 +693,13 @@ class File extends Managed_DataObject
|
|||
return $title ?: null;
|
||||
}
|
||||
|
||||
public function setTitle($title)
|
||||
{
|
||||
$orig = clone($this);
|
||||
$this->title = mb_strlen($title) > 0 ? $title : null;
|
||||
return $this->update($orig);
|
||||
}
|
||||
|
||||
static public function hashurl($url)
|
||||
{
|
||||
if (empty($url)) {
|
||||
|
|
|
@ -174,7 +174,9 @@ class OembedPlugin extends Plugin
|
|||
if ($oembed_data === false) {
|
||||
throw new Exception('Did not get oEmbed data from URL');
|
||||
}
|
||||
$file->setTitle($oembed_data->title);
|
||||
} catch (Exception $e) {
|
||||
common_log(LOG_WARN, sprintf(__METHOD__.': %s thrown when getting oEmbed data: %s', get_class($e), _ve($e->getMessage())));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user