]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
redir_info only has data if we ran discovery
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 8 Dec 2015 10:42:09 +0000 (11:42 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 8 Dec 2015 10:42:09 +0000 (11:42 +0100)
classes/File_redirection.php

index 0d90b9e82c0016040e8bf9f3fd83f7653be04d07..bb8ffc8c61301d3cf281382d719406354bf0dd81 100644 (file)
@@ -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;
     }