summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2010-08-12 15:19:47 -0700
committerBrion Vibber <brion@status.net>2010-08-12 15:25:32 -0700
commitf7d599f8eac0a9e3d47c3ff2f074bed0b6e9c124 (patch)
tree86d74feefe36d91f52d5ba9548de972acf605049 /classes
parent78eea352b4ad142e58b598c50929d5a4edb991fc (diff)
Fix for ticket 2513: "Can't linkify" error when some links are shortened
When bogus SSL sites etc were hit through a shortening redirect, sometimes link resolution kinda blew up and the user would get a "Can't linkify" error, aborting their post. Now catching this case and just passing through the URL without attempting to resolve it. Could benefit from an overall scrubbing of the freaky link/attachment code though...! :) http://status.net/open-source/issues/2513
Diffstat (limited to 'classes')
-rw-r--r--classes/File_redirection.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/File_redirection.php b/classes/File_redirection.php
index f128b3e07..51b8be3b0 100644
--- a/classes/File_redirection.php
+++ b/classes/File_redirection.php
@@ -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 {