Re: What may be wrong with ereg...

From: Date: Fri, 15 Dec 2000 10:22:36 +0000
Subject: Re: What may be wrong with ereg...
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-30488@lists.php.net to get a copy of this message
Daniel Convissor wrote: > > Hey Sylwester: > > > > What that expression you wrote does is return true if the file > > > name evaluated contains any of the following character combinations: > > > / > > > ../ > > > \ > > This works for me... > ereg ( "../|[/\]", $HTTP_POST_FILES [ "filename" ] [ "name" ] > ) Yes, but ".." (two dots) mask any two chars, shouldn't it be: ereg ( "\.\./|[/\]", $var ); And why not two backslashes (first escaping second), and why with brackets ?? Egrep with my expression work as expected. Is there any exceptions for using regular grep regexp's in PHP ??? > There are probably other ways to do it too... I try to find one best :-) -- pozdrawiam.. ## ## | Sylwester Zarębski - ISP Group | #### ## | e-mail: sylwek@isp.net.pl | ## ## ## | ICQ uin: #45780888 | ## #### ## | Administrator ISP.NET.PL |

« previous php.general (#30488) next »