path traversal exploit fix from upstream
All checks were successful
Build and publish the docker image / build (push) Successful in 1m4s
All checks were successful
Build and publish the docker image / build (push) Successful in 1m4s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
e9bbc0f307
commit
7a4806c5a3
@ -12,11 +12,16 @@ new favicon($_GET["s"]);
|
|||||||
class favicon{
|
class favicon{
|
||||||
|
|
||||||
public function __construct($url){
|
public function __construct($url){
|
||||||
|
|
||||||
header("Content-Type: image/png");
|
header("Content-Type: image/png");
|
||||||
|
|
||||||
if(substr_count($url, "/") !== 2){
|
if(
|
||||||
|
preg_match(
|
||||||
|
'/^https?:\/\/[A-Za-z0-9.-]+$/',
|
||||||
|
$url
|
||||||
|
) === 0
|
||||||
|
){
|
||||||
|
|
||||||
header("X-Error: Only provide the protocol and domain");
|
header("X-Error: Only provide the protocol and domain");
|
||||||
$this->defaulticon();
|
$this->defaulticon();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user