diff options
author | Case Duckworth | 2023-01-20 15:36:44 -0600 |
---|---|---|
committer | Case Duckworth | 2023-01-20 15:50:33 -0600 |
commit | 7b9d472e06172cc7b40936cbae0f05289b10ef15 (patch) | |
tree | f76f5723c767cd296d08aa5be9e94659e76e9719 | |
parent | Style images (diff) | |
download | superstack-7b9d472e06172cc7b40936cbae0f05289b10ef15.tar.gz superstack-7b9d472e06172cc7b40936cbae0f05289b10ef15.zip |
Some hardening
-rw-r--r-- | superstack.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/superstack.php b/superstack.php index c02ae6d..306b7b3 100644 --- a/superstack.php +++ b/superstack.php | |||
@@ -1,5 +1,18 @@ | |||
1 | <?php | 1 | <?php |
2 | $site = urldecode($_GET['page']); | 2 | $site = $_GET['page']; |
3 | |||
4 | if (empty($site)) { | ||
5 | echo "Superstack!\n"; | ||
6 | return; | ||
7 | } | ||
8 | |||
9 | if (! preg_match('/substack\.com/', $site)) { | ||
10 | echo "Requires a substack URL!"; | ||
11 | return; | ||
12 | } | ||
13 | |||
14 | $site = urldecode($site); | ||
15 | |||
3 | $ch = curl_init($site); | 16 | $ch = curl_init($site); |
4 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | 17 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
5 | $page = curl_exec($ch); | 18 | $page = curl_exec($ch); |
@@ -47,3 +60,4 @@ foreach ($content as $el) { | |||
47 | 60 | ||
48 | </body> | 61 | </body> |
49 | </html> | 62 | </html> |
63 | |||