Skip to content

Instantly share code, notes, and snippets.

@damncabbage
Forked from mwotton/gist:6077238
Last active December 20, 2015 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damncabbage/6077544 to your computer and use it in GitHub Desktop.
Save damncabbage/6077544 to your computer and use it in GitHub Desktop.
<?php
header("Content-Disposition: binary/data");
preg_match('/([^\/]+)\/favicon.ico/', $_SERVER['REQUEST_URI'], $matches);
echo (file_exists(getenv('cachedir').'/'.$matches[1]) ? file_put_contents(getenv('cachedir').'/'.$matches[1], file_get_contents('http://'.$matches[1].'/favicon.ico')) : file_get_contents(getenv('cachedir').'/'.$matches[1]));
// see that. thats fucking magestic is what it is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment