]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File_redirection.php
* i18n/L10n and translator documentation updates.
[quix0rs-gnu-social.git] / classes / File_redirection.php
index f128b3e07c84179e92369de9b732800da1000d16..68fed77e8bb3eef6402fc0b737676c193cf3b420 100644 (file)
@@ -210,6 +210,14 @@ class File_redirection extends Memcached_DataObject
                 } else if (is_string($redir_data)) {
                     // The file is a known redirect target.
                     $file = File::staticGet('url', $redir_data);
+                    if (empty($file)) {
+                        // @fixme should we save a new one?
+                        // this case was triggering sometimes for redirects
+                        // with unresolvable targets; found while fixing
+                        // "can't linkify" bugs with shortened links to
+                        // SSL sites with cert issues.
+                        return null;
+                    }
                     $file_id = $file->id;
                 }
             } else {
@@ -273,4 +281,3 @@ class File_redirection extends Memcached_DataObject
         $file_redir->insert();
     }
 }
-