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
+11 -1
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);
+2 -2
View File
@@ -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
+1 -1
View File
@@ -61,7 +61,7 @@ elseif (isset($_GET['action']) && $_GET['action'] == "edit" && isset($_GET['id']
print("<tr><td>Category:</td><td><select style=\"width: 400px;\" name=\"categ\" />");
$res2 = sql_query("SELECT `id`, `question`, `link_id` FROM `faq` WHERE `type`='categ' AND `lang_id` = ".sqlesc($lang_id)." ORDER BY `order` ASC");
while ($arr2 = mysql_fetch_array($res2, MYSQLI_BOTH)) {
$selected = ($arr2['link_id'] == $arr[categ]) ? " selected=\"selected\"" : "";
$selected = ($arr2['link_id'] == $arr['categ']) ? " selected=\"selected\"" : "";
print("<option value=\"{$arr2['link_id']}\"". $selected .">{$arr2['question']}</option>");
}
print("</td></tr>\n");
+1 -1
View File
@@ -14,7 +14,7 @@ function bark($msg)
$id = intval($_GET['id'] ?? 0);
int_check($id,true);
if (get_user_class() >= UC_MODERATOR || $CURUSER[id] == "$id")
if (get_user_class() >= UC_MODERATOR || $CURUSER['id'] == "$id")
{
$deadtime = deadtime();
sql_query("DELETE FROM peers WHERE last_action < FROM_UNIXTIME($deadtime) AND userid=" . sqlesc($id));