security fix shieet

This commit is contained in:
lolcat 2023-09-04 10:17:08 -04:00
parent 38b97a26e5
commit 5b8c9eaed7
2 changed files with 63 additions and 54 deletions

View file

@ -1,47 +1,62 @@
<?php <?php
/*
this file exists to separate instance data from the actual about page // this file exists to separate instance data from the actual about page
HTML, and to make it easier to add/modify instances cleanly. // HTML, and to make it easier to add/modify instances cleanly.
*/
$instancelist = [ $instancelist = [
[ [
"name" => "lolcat's instance (master)", "name" => "lolcat's instance (master)",
"address" => [ "address" => [
"uri" => "https://4get.ca/", "uri" => "https://4get.ca/",
"displayname" => "4get.ca" "displayname" => "4get.ca"
], ],
"altaddresses" => [ // all these address blocks will be linked in parentheses "altaddresses" => [
[ // e.g. 4get.ca (tor) (i2p) etc. [
"uri" => "http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion", // all these address blocks will be linked in parentheses
"displayname" => "tor" // e.g. 4get.ca (tor) (i2p) etc.
] "uri" => "http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion",
] "displayname" => "tor"
], ]
[ ]
"name" => "zzls's instance", ],
"address" => [ [
"uri" => "https://4get.zzls.xyz/", "name" => "zzls's Chilean instance",
"displayname" => "4get.zzls.xyz" "address" => [
], "uri" => "https://4get.zzls.xyz/",
"altaddresses" => [ "displayname" => "4get.zzls.xyz"
[ ],
"uri" => "http://4get.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion", "altaddresses" => [
"displayname" => "tor" [
] "uri" => "http://4get.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion",
] "displayname" => "tor"
], ]
[ ]
"name" => "4get on a silly computer", ],
"address" => [ [
"uri" => "https://4get.silly.computer", "name" => "zzls's United States instance",
"displayname" => "4get.silly.computer" "address" => [
], "uri" => "https://4getus.zzls.xyz/",
"altaddresses" => [ "displayname" => "4getus.zzls.xyz"
[ ],
"uri" => "https://4get.cynic.moe/", "altaddresses" => [
"displayname" => "fallback domain" [
] "uri" => "http://4getus.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion",
] "displayname" => "tor"
], ]
]
],
[
"name" => "4get on a silly computer",
"address" => [
"uri" => "https://4get.silly.computer",
"displayname" => "4get.silly.computer"
],
"altaddresses" => [
[
"uri" => "https://4get.cynic.moe/",
"displayname" => "fallback domain"
]
]
]
] ]
?> ?>

View file

@ -128,12 +128,9 @@ class proxy{
} }
// sanitize URL // sanitize URL
try{ if($this->validateurl($url) === false){
$this->validateurl($url); throw new Exception("Invalid URL");
}catch(Exception $error){
throw new Exception($error->getMessage());
} }
$this->clientcache(); $this->clientcache();
@ -353,12 +350,9 @@ class proxy{
$this->format = $format; $this->format = $format;
// sanitize URL // sanitize URL
try{ if($this->validateurl($url) === false){
$this->validateurl($url); throw new Exception("Invalid URL");
}catch(Exception $error){
throw new Exception($error->getMessage());
} }
$this->clientcache(); $this->clientcache();