oshanrube / owasp-esapi-php

Automatically exported from code.google.com/p/owasp-esapi-php
Other
0 stars 0 forks source link

isValidPrintable() results in getESAPIValidationExpression: Cannot find regular expression #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. check the character 'a' (or any other) with isValidPrintable()  
[DefaultValidator.php]

What is the expected output? 
return value true.

What do you see instead?
getESAPIValidationExpression: Cannot find regular expression: 
^[\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f0-9\x3a\x3b\x3
c\x3d\x3e\x3f\x40A-Z\x5b\x5c\x5d\x5e\x5f\x60a-z\x7b\x7c\x7d\x7e]*$

What version of the product are you using? On what operating system?
I'm using svn revision 823.

Please provide any additional information below.
I chanced isValidPrintable() and added the regex (previously located in 
DefaultValidator.php) to ESAPI.xml with the name 'Printable' - this might be a 
valid fix:

See the attached file for the changes.
If this is a valid fix unused functions that were previously used by  
isValidPrintable() maybe removed.

Original issue reported on code.google.com by cas...@gmail.com on 12 Jan 2011 at 7:13

Attachments:

GoogleCodeExporter commented 9 years ago
I agree wholeheartedly that the regex used by 
DefaultValidator->_assertValidPrintable should be defined in ESAPI.xml and this 
is now fixed in r824.

Thanks for the report and for the patches!

Original comment by jahboite@gmail.com on 14 Jan 2011 at 4:08