about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2023-01-20 15:36:44 -0600
committerCase Duckworth2023-01-20 15:50:33 -0600
commit7b9d472e06172cc7b40936cbae0f05289b10ef15 (patch)
treef76f5723c767cd296d08aa5be9e94659e76e9719
parentStyle images (diff)
downloadsuperstack-7b9d472e06172cc7b40936cbae0f05289b10ef15.tar.gz
superstack-7b9d472e06172cc7b40936cbae0f05289b10ef15.zip
Some hardening
-rw-r--r--superstack.php16
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
4if (empty($site)) {
5 echo "Superstack!\n";
6 return;
7}
8
9if (! 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);
4curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 17curl_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