Opened 17 years ago

Closed 16 years ago

#1380 closed New Feature (duplicate)

remove special characters in uploaded file URL

Reported by: nicolefou@… Owned by:
Priority: Normal Milestone:
Component: Server : PHP Version:
Keywords: HasPatch Cc:

Description

Add the following line in the /filemanager/browser/default/connectors/php/commands.php file in order to replace all characters unreadable in an URL by an underscore (_)

In function FileUpload around line 143 after

// Get the uploaded file name.
$sFileName = $oFile['name'] ;
$sOriginalFileName = $sFileName ;

#### LINE TO ADD ####

$sFileName = eregi_replace("[^a-z0-9.]", "_", $sFileName);

Could be a lot improved because it only keep the numerical and alphabetical characters and the point (for file extension) but it was enough for my need ;-)

Cheers Nicolas


Moved from SF

Change History (3)

comment:1 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Reporter: changed from Alfonso Martínez de Lizarrondo to nicolefou@…

comment:2 Changed 16 years ago by Wojciech Olchawa

Keywords: HasPatch added

comment:3 Changed 16 years ago by Wiktor Walc

Resolution: duplicate
Status: newclosed

This issue is described in #1842, so closing this one.

It is generally not a good idea to remove all characters other than [a-z0-9.] to get rid of that problem.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy