- // This is a special treatment for picture upload from Twidere
- if (($filename == "octet-stream") && ($filetype != "")) {
- $filename = $filetype;
- $filetype = "";
- }
-
- if ($filetype == "") {
- $filetype = Images::guessType($filename);
- }
-
- // If there is a temp name, then do a manual check
- // This is more reliable than the provided value
-
- $imagedata = getimagesize($src);
- if ($imagedata) {
- $filetype = $imagedata['mime'];
- }