fix common undefined constant error

This commit is contained in:
xiaomlove
2021-03-30 00:03:10 +08:00
parent 32b0493913
commit 32dee2d6e3
4 changed files with 15 additions and 5 deletions

View File

@@ -49,7 +49,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST")
stderr($lang_bitbucketupload['std_image_processing_failed'],$lang_bitbucketupload['std_sorry_the_uploaded']."$imgtypes[$it]".$lang_bitbucketupload['std_failed_processing']);
$thumb = imagecreatetruecolor($newwidth, $newheight);
imagecopyresized($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$ret=($it==1)?imagegif($thumb, $tgtfile): ($it==2)?imagejpeg($thumb, $tgtfile):imagepng($thumb, $tgtfile);
switch ($it) {
case 1:
$ret = imagegif($thumb, $tgtfile);
break;
case 2:
$ret = imagejpeg($thumb, $tgtfile);
break;
default:
$ret = imagepng($thumb, $tgtfile);
}
// $ret=($it==1)?imagegif($thumb, $tgtfile): ($it==2)?imagejpeg($thumb, $tgtfile):imagepng($thumb, $tgtfile);
$url = str_replace(" ", "%20", htmlspecialchars(get_protocol_prefix()."$BASEURL/bitbucket/$filename"));
$name = sqlesc($filename);