News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 17, 2019, 04:01:40 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189090
  • Total Topics: 20764
  • Online Today: 53
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 47
Total: 47

Author Topic: DL Manager - Upload file extensions  (Read 1565 times)

0 Members and 1 Guest are viewing this topic.

Leviathan

  • Guest
DL Manager - Upload file extensions
« on: October 13, 2006, 08:01:11 AM »
wouldn't it make more sense if the file format/extension check is not case sensitive? Sure you could add the allowed extensions both in lower and upper case, but is there really any point in allowing .jpg and not .JPG files?

Anyway, I've made the following change in the TPdlmanager.php file to accomplish this, works for me :)

replace:
Code: [Select]
if(substr($name, strlen($name)-$extlen, $extlen)==$ext)
with:
Code: [Select]
if(strcasecmp(substr($name, strlen($name)-$extlen, $extlen), $ext)==0)

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: DL Manager - Upload file extensions
« Reply #1 on: October 15, 2006, 01:52:04 AM »
Well, for the normal ones it wouldn't matter, but in case of any obscure ones its done this way.

Besides, extension case are the uploaders responsibility, not TP. If someone insist on mixing them - which is a bad habit, many servers are sensitive to case in names - then at least admin can control it by adding all the variations.