Previous Thread
Next Thread
Print Thread
Rate Thread
#101770 11/26/2000 8:52 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
LOL, thx guys [Linked Image]

To keep up with tradition though, andy...you're about 99% of the way correct with:

die 'Bad characters in file name.' unless($file_name =~ /^[A-Za-z0-9]$/);

however ya made one BIIIIIG blunder. That regex only allows for a one character filename [Linked Image]

and a smaller blunder... it doesn't allow for '.', _ and - which are perfectly valid in filenames.

I would use full on taint checking:

die 'Bad characters in file name.' unless $file_name =~ /^([w.-]+)$/;
$file_name = $1;

--mark

This message has been edited by Mark Badolato on November 26, 2000 at 07:53 PM


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Sponsored Links
Entire Thread
Subject Posted By Posted
Making Files Em8 11/25/2000 3:12 AM
Re: Making Files The Team 11/25/2000 4:09 AM
Re: Making Files zanardi 11/26/2000 2:37 AM
Re: Making Files The Team 11/26/2000 3:07 AM
Re: Making Files Dave_L 11/26/2000 4:40 AM
Re: Making Files The Team 11/26/2000 8:51 PM
Re: Making Files Greg Hard 11/26/2000 8:58 PM
Re: Making Files The Team 11/26/2000 9:39 PM
Re: Making Files Greg Hard 11/26/2000 9:47 PM
Re: Making Files Em8 11/26/2000 10:06 PM
Re: Making Files Greg Hard 11/26/2000 11:00 PM
Re: Making Files The Team 11/27/2000 3:40 AM
Re: Making Files Greg Hard 11/27/2000 3:46 AM
Re: Making Files Mark Badolato 11/27/2000 3:52 AM
Re: Making Files Greg Hard 11/27/2000 3:54 AM
Re: Making Files The Team 11/27/2000 4:00 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,825
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 2595
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 5
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)