make sure the request was successful

This commit is contained in:
Colin Mitchell 2013-06-13 18:58:18 -04:00
parent 59140f3256
commit b55eb0a047
1 changed files with 1 additions and 3 deletions

View File

@ -78,12 +78,10 @@ function loadGopher($url, $input) {
error_log("$url $input");
$x = new GopherGetter($url, $input);
if ( $x->isValid() ) {
$x->get();
if ( $x->isValid() && $x->get() ) {
// send binary files and large text back as an attachment
if ( $x->isBinary() || $x->size() > 1000000 ) {
error_log("binar!");
$result['url'] = "/file?name=" . basename($url) . "&path=" . $x->urlFor();
$result['image'] = $x->isImage();
}