Browse Source

fix extension fix

remotes/r4jeshwar/master
Go Johansson 5 months ago
parent
commit
fb13a2a304
  1. 2
      dist.json
  2. 2
      package.json
  3. 23
      static/php/includes/Upload.class.php

2
dist.json

@ -3,7 +3,7 @@
"allowErrors": false
},
"dest": "dist",
"pkgVersion": "1.5.0",
"pkgVersion": "1.5.1",
"banners": [
"banners/malware_scans.swig",
"banners/donations.swig"

2
package.json

@ -1,6 +1,6 @@
{
"name": "uguu",
"version": "1.5.0",
"version": "1.5.1",
"description": "Kawaii file host",
"homepage": "https://uguu.se/",
"repository": {

23
static/php/includes/Upload.class.php

@ -119,19 +119,34 @@ class Upload
];
}
public static function getIP()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
self::$IP = $_SERVER['HTTP_CLIENT_IP'];
}
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
self::$IP = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
if (!isset(self::$IP)) {
self::$IP = $_SERVER['REMOTE_ADDR'];
}
}
public static function fileInfo()
{
if (isset($_FILES['files'])) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
self::$FILE_MIME = finfo_file($finfo, self::$TEMP_FILE);
$extension = explode('.', self::$FILE_NAME, 2);
self::$FILE_EXTENSION = $extension['1'];
finfo_close($finfo);
$extension = explode('.', self::$FILE_NAME);
self::$FILE_EXTENSION = $extension[count($extension)-2].'.'.$extension[count($extension)-1];
if (Settings::$LOG_IP) {
self::$IP = $_SERVER['REMOTE_ADDR'];
self::getIP();
} else {
self::$IP = '0';
self::$IP = null;
}
}
}

Loading…
Cancel
Save