File_redirection->getFile could never get the file anyway if $redir->file_id was empty...

This commit is contained in:
Mikael Nordfeldth 2017-05-02 09:07:00 +02:00
parent 5af5bb2a32
commit 06b25f384a
1 changed files with 1 additions and 4 deletions

View File

@ -126,10 +126,7 @@ class File_oembed extends Managed_DataObject
} catch (NoResultException $e) {
// File_redirection::where argument 'discover' is false to avoid loops
$redir = File_redirection::where($given_url, false);
if (empty($redir->file_id)) {
$f = $redir->getFile();
$file_oembed->mimetype = $f->mimetype;
} else {
if (!empty($redir->file_id)) {
$file_id = $redir->file_id;
}
}