Respect Validation - Usage Not & One Of

83 Views Asked by At

The user enters his/her business name. Every this is allowed except special characters. Instead of a white list I would want to main a blacklist. Here's my piece of code

'nameofbusiness' => v::not (
                            v::oneOf ( 
                                                v::contains( '~'), v::contains ( '+' ), 
                                                v::contains( '-' ),v::contains ( '!' ), 
                                                v::contains( '@' ),v::contains ( '$' ), 
                                                v::contains ( '%' ), v::contains ( '^' ), 
                                                v::contains ( '&' ), v::contains ( '*' ), 
                                                v::contains ( '(' ), v::contains ( ')' ), 
                                                v::contains ( '[' ), v::contains ( ']' ), 
                                                v::contains ( '=' ), v::contains ( '_' ), 
                                                v::contains ( '/' ), v::contains ( '?' ), 
                                                v::contains ( '>' ), v::contains ( '<' ), 
                                                v::contains ( '.' ), v::contains ( ',' ), 
                                                v::contains ( ':' ), v::contains ( ';' ), 
                                                v::contains ( '"' ) 
                                       )
                            )

+(plus) #(hash) and &(ampersand) are slipping through these gates. How can i make sure that they don't? Any help would be very much appreciated.

0

There are 0 best solutions below