PHP Classes

regular expression validation

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  regular expression validation  >  (Un) Subscribe thread alerts  
Subject:regular expression validation
Summary:ValidateRegularExpression not working on server side
Messages:14
Author:Thomas
Date:2007-05-25 19:05:19
Update:2007-05-29 22:03:17
 
  1 - 10   11 - 14  

  11. Re: regular expression validation   Reply   Report abuse  
Picture of Thomas Thomas - 2007-05-28 15:28:01 - In reply to message 10 from Thomas
Excuse me, every sentence noy word. Example:

send me a sample

will throw a server side validation error

  12. Re: regular expression validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-05-28 18:32:57 - In reply to message 11 from Thomas
You regular expression would not validate the "send me a sample".

If it did not complain on the browser side, maybe the page has some Javascript error that is preventing that the validation happens.

I may want to try this other regular expression:

"^([ \t\r\n]*[a-zA-Z0-9]+[ \t\r\n]*)+$"

  13. Re: regular expression validation   Reply   Report abuse  
Picture of Thomas Thomas - 2007-05-29 16:10:39 - In reply to message 12 from Manuel Lemos
Hi Manuel,
thanks, it's working perfectly now.

I would like to stress only one point left: how do you deal with null ascii chars?

I saw that all your classes rely on the ereg function, that can has a great bug with binary injected strings.
How is the issue solved in your classes?

Thanks a lot,


Thomas Smithson

  14. Re: regular expression validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-05-29 22:03:17 - In reply to message 13 from Thomas
The class uses POSIX regular expression functions because those are compatible with the regular expressions supported by Javascript.

I am not aware of any issues with NUL characters. If there is a bug in PHP implementation, I am afraid there is not much that can be done to fix that bug other than reporting the bug to PHP developers.

 
  1 - 10   11 - 14