mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-10-04 23:13:01 +02:00
parse url for filename if no content-disposition
This commit is contained in:
12
upload.php
12
upload.php
@@ -34,11 +34,23 @@
|
|||||||
if(strpos($hd, "Content-Type") === 0){
|
if(strpos($hd, "Content-Type") === 0){
|
||||||
$nt = explode(": ", $hd);
|
$nt = explode(": ", $hd);
|
||||||
$mime = $nt[1];
|
$mime = $nt[1];
|
||||||
|
if(strpos($mime, ";") > 0){
|
||||||
|
$ms = explode(";", $mime);
|
||||||
|
$mime = $ms[0];
|
||||||
|
}
|
||||||
}else if(strpos($hd, "Content-Disposition") === 0){
|
}else if(strpos($hd, "Content-Disposition") === 0){
|
||||||
$nn = explode("filename=", $hd);
|
$nn = explode("filename=", $hd);
|
||||||
$fname = str_replace("\"", "", $nn[1]);
|
$fname = str_replace("\"", "", $nn[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($fname == "remote"){
|
||||||
|
//parse url if no content-disposition is set
|
||||||
|
preg_match('@^.*\/(.*\.[a-zA-Z0-9]{0,4})@i', $_GET["remote"], $matches);
|
||||||
|
if(count($matches) > 0){
|
||||||
|
$fname = $matches[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmpf = fopen("php://temp", 'rb+');
|
$tmpf = fopen("php://temp", 'rb+');
|
||||||
|
Reference in New Issue
Block a user