From 441e2c8d34f7d1eacb153603d3f0f5f878a3003c Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 8 Dec 2015 11:42:09 +0100 Subject: [PATCH] redir_info only has data if we ran discovery --- classes/File_redirection.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/classes/File_redirection.php b/classes/File_redirection.php index 0d90b9e82c..bb8ffc8c61 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -192,16 +192,18 @@ class File_redirection extends Managed_DataObject if (!empty($r->file_id)) { return $r; } - } - $redir->httpcode = $redir_info['code']; - $redir->redirections = intval($redir_info['redirects']); - $redir->file = new File(); - $redir->file->url = $redir_info ? $redir_info['url'] : $in_url; - $redir->file->mimetype = $redir_info['type']; - $redir->file->size = $redir_info['size']; - $redir->file->date = $redir_info['time']; - if($redir_info['protected']) $redir->file->protected = true; + $redir->httpcode = $redir_info['code']; + $redir->redirections = intval($redir_info['redirects']); + $redir->file = new File(); + $redir->file->url = $redir_info ? $redir_info['url'] : $in_url; + $redir->file->mimetype = $redir_info['type']; + $redir->file->size = $redir_info['size']; + $redir->file->date = $redir_info['time']; + if ($redir_info['protected']) { + $redir->file->protected = true; + } + } return $redir; } -- 2.39.5