blob: e8ea59f2e77077c63c448c0a7903eef2147dbecc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<?php
if (isset($_GET["_"])) {
$f = trim($_GET["_"]);
} else {
die();
}
header("Content-Type: image/png");
if (str_contains($f, "/") || str_contains($f, ".") || trim($f) === "") die();
$f = str_replace(":", "-", $f);
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/images/" . $f . ".png")) {
$url = $_SERVER['DOCUMENT_ROOT'] . "/data/images/" . $f . ".png";
} else {
$url = "https://www.gravatar.com/avatar/" . md5($f) . "?f=y&d=identicon&s=256";
}
die(file_get_contents($url));
|