-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
34 lines (20 loc) · 733 Bytes
/
api.php
File metadata and controls
34 lines (20 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
// Made By PythonScratcher (PythonScratcher.eu.org) (THIS CREDIT IS REQUIRED)
if (isset($_GET['url'])) {
$url = $_GET['url'];
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url = "http://" . $url;
}
$filename = substr(md5(uniqid()), 0, rand(8, 10));
$directory = "f/$filename";
if (!file_exists($directory)) {
mkdir($directory, 0755, true);
}
$content = "<?php header('Location: $url'); ?>";
file_put_contents("$directory/index.php", $content);
$domain = $_SERVER['HTTP_HOST'];
$shortUrl = "http://" . $domain . "/$directory";
echo "$shortUrl";
echo "<!-- Made By PythonScratcher (PythonScratcher.eu.org) (THIS CREDIT IS REQUIRED) -->";
}
?>