Skip to content

Commit

Permalink
Hackish fix when default twitter avatars were being cached for the fi…
Browse files Browse the repository at this point in the history
…rst time, then the O_o icon was returning 200 OK - thus causing it never to update.
  • Loading branch information
remy committed Jun 17, 2009
1 parent 14df426 commit ee7a4a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.php
Expand Up @@ -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);
Expand Down

0 comments on commit ee7a4a2

Please sign in to comment.