TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 296
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 289
  • Total: 289

DL Manager - Upload file extensions

Started by Leviathan, October 13, 2006, 03:01:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leviathan

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:
if(substr($name, strlen($name)-$extlen, $extlen)==$ext)

with:
if(strcasecmp(substr($name, strlen($name)-$extlen, $extlen), $ext)==0)

bloc

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.