Skip to content

Commit

Permalink
Proper checking the curl response for a 404
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Jun 1, 2009
1 parent 250b727 commit 316a864
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.php
Expand Up @@ -24,7 +24,11 @@ function head($image_url) {

$res = curl_exec( $c );

return $res;
if (preg_match('@HTTP/1.1 404 Not Found@', $res)) {
return false;
} else {
return true;
}
}

function size_image($image_url, $size) {
Expand Down

0 comments on commit 316a864

Please sign in to comment.