// no content it'll be cheap. :)
$request = self::_commonHttp($short_url, $redirs);
$response = $request->send();
+ } elseif (400 == $response->getStatus()) {
+ throw new Exception('Got error 400 on HEAD request, will not go further.');
}
} catch (Exception $e) {
// Invalid URL or failure to reach server
try {
$r = File_redirection::getByUrl($in_url);
- $f = File::getKV('id',$r->file_id);
-
- if($file instanceof File) {
+ try {
+ $f = File::getByID($r->file_id);
$r->file = $f;
- $r->redir_url = $f->url;
- } else {
+ $r->redir_url = $f->url;
+ } catch (NoResultException $e) {
// Invalid entry, delete and run again
common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File redirection entry and and trying again...");
$r->delete();
// don't touch anything
break;
+ // URLs with coordinates, not browsable domain names
+ case 'geo':
+ // don't touch anything
+ break;
+
default:
$out_url = $default_scheme . ltrim($out_url, '/');
$p = parse_url($out_url);
return $this->file;
}
-}
\ No newline at end of file
+}