Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Proper checking the curl response for a 404

  • Loading branch information...
commit 316a8648e1ffe8b75c37602a2131de78dee48154 1 parent 250b727
Remy Sharp authored June 01, 2009

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  index.php
6  index.php
@@ -24,7 +24,11 @@ function head($image_url) {
24 24
 
25 25
     $res = curl_exec( $c );
26 26
     
27  
-    return $res;
  27
+    if (preg_match('@HTTP/1.1 404 Not Found@', $res)) {
  28
+        return false;
  29
+    } else {
  30
+        return true;
  31
+    }
28 32
 }
29 33
 
30 34
 function size_image($image_url, $size) {

0 notes on commit 316a864

Please sign in to comment.
Something went wrong with that request. Please try again.