Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th December 2005, 20:19
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default preg_math, I need to allow character /

I got this code from another tool, and i want to allow the character / because it would be part of the instalation tool that I'm developing. How can I allow the character / ?

Code:
# If strange characters in $install_path, then error
if(!preg_match("/^[a-zA-Z0-9\-\.]{0,255}$/",$install_path)) $go_api->errorMessage($go_api->lng("The instalation path contains invalid characters."));
thank you.
Reply With Quote
Sponsored Links
  #2  
Old 27th December 2005, 15:12
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
 
Default

you can try this (untested!):

Code:
# If strange characters in $install_path, then error
if(!preg_match("/^[a-zA-Z0-9\-\.\/]{0,255}$/",$install_path)) $go_api->errorMessage($go_api->lng("The instalation path contains invalid characters."));
or this:

Code:
# If strange characters in $install_path, then error
if(!preg_match("°^[a-zA-Z0-9\-\./]{0,255}$°",$install_path)) $go_api->errorMessage($go_api->lng("The instalation path contains invalid characters."));
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:57.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.