From 32dee2d6e3c25c94c29ff55535aceba8224d1ca6 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 30 Mar 2021 00:03:10 +0800 Subject: [PATCH] fix common undefined constant error --- public/bitbucket-upload.php | 12 +++++++++++- public/downloadsubs.php | 4 ++-- public/faqactions.php | 2 +- public/takeflush.php | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/public/bitbucket-upload.php b/public/bitbucket-upload.php index 92dd9dc7..7ff5a71d 100644 --- a/public/bitbucket-upload.php +++ b/public/bitbucket-upload.php @@ -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); diff --git a/public/downloadsubs.php b/public/downloadsubs.php index 979a2a8d..77472ed1 100644 --- a/public/downloadsubs.php +++ b/public/downloadsubs.php @@ -46,11 +46,11 @@ else if ( str_replace("Opera", "", $_SERVER['HTTP_USER_AGENT']) != $_SERVER['HTT } else if ( str_replace("IE", "", $_SERVER['HTTP_USER_AGENT']) != $_SERVER['HTTP_USER_AGENT'] ) { - header ("Content-Disposition: attachment; filename=".str_replace("+", "%20", rawurlencode($arr[filename]))); + header ("Content-Disposition: attachment; filename=".str_replace("+", "%20", rawurlencode($arr['filename']))); } else { - header ("Content-Disposition: attachment; filename=".str_replace("+", "%20", rawurlencode($arr[filename]))); + header ("Content-Disposition: attachment; filename=".str_replace("+", "%20", rawurlencode($arr['filename']))); } do diff --git a/public/faqactions.php b/public/faqactions.php index 86aa04c7..b89f32a2 100644 --- a/public/faqactions.php +++ b/public/faqactions.php @@ -61,7 +61,7 @@ elseif (isset($_GET['action']) && $_GET['action'] == "edit" && isset($_GET['id'] print("Category: