From ee7a4a2b0b82e56f24d357eede82798ab0f801dd Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 17 Jun 2009 23:11:05 +0100 Subject: [PATCH] Hackish fix when default twitter avatars were being cached for the first time, then the O_o icon was returning 200 OK - thus causing it never to update. --- index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 0022624..389c5fe 100644 --- a/index.php +++ b/index.php @@ -69,8 +69,9 @@ function redirect($image_url, $size, $db) { } else if (mysql_num_rows($result) > 0) { // test if URL is available - then redirect $row = mysql_fetch_object($result); - - if (head($row->url)) { + + // if the url returned is one of Twitter's O_o static ones, then do a grab + if (!preg_match('/static\.twitter\.com', $row->url) && head($row->url)) { redirect($row->url, $size, $db); } else { // else grab and store - then redirect $image_url = grab_and_store($user, $db);