Skip to content

Commit

Permalink
Refine index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanSara committed Apr 16, 2021
1 parent b8676a6 commit 4fc381f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions remote-server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
$imagetype = $_FILES['photo']['type'];
$imageerror = $_FILES['photo']['error'];
$imagetemp = $_FILES['photo']['tmp_name'];

// Fix Chrome quirk
$config = str_replace('\r\n', '\n', $config); // The single quotes here distinguish a literal \r from a "real" \r, and we want the former

// Logs are being uploaded - store them
if ($logs){
Expand All @@ -46,7 +43,6 @@
}
}


// A photo is being uploaded - store it and if needed delete/rename the others
if ($imagename){
if(is_uploaded_file($imagetemp)) {
Expand All @@ -62,7 +58,7 @@
// If a maximum number of photos ia allowed, add a prefix to the current photo
if($maxPhotos > 1){
$split_name = explode(".", $imagename);
$imagename = $split_name[0]."__1.".$split_name[1];
$imagename = $split_name[0]."__0.".$split_name[1];

// Delete the oldest pictures if there are more than maxPhotos pictures
$pictures = glob($image_path."*.{jpg,png,gif}", GLOB_BRACE);
Expand Down Expand Up @@ -131,4 +127,3 @@
echo json_encode($response)."\n";
}
?>

0 comments on commit 4fc381f

Please sign in to comment.