logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

AW: Zend_Validate_Alnum::isValid evaluating alnum strings as false: msg#00477

Subject: AW: Zend_Validate_Alnum::isValid evaluating alnum strings as false

Maybe i don’t get it.. but alnum should represent the character class [A-Za-z0-9]+ and this should match „foobar1“

 

Von: Andries Seutens [mailto:andries.seutens-AgBVmzD5pcezQB+pC5nmwQ@xxxxxxxxxxxxxxxx]
Gesendet: Freitag, 22. Juni 2007 15:36
An: Darby Felton
Cc: Graham Anderson; fw-general-wwOhfgvld6hpLGFMi4vTTA@xxxxxxxxxxxxxxxx
Betreff: Re: [fw-general] Zend_Validate_Alnum::isValid evaluating alnum strings as false

 

Hi,

Sorry, but nor "foobar1" and "foob@r1" would *not* pass this validator, as they are *not* "AlNum"...

Your result: "foobar1:false foob@r1:false" is pretty ok....

Best,

Andries Seutens

Darby Felton schreef:

Hi Graham,
 
I just added the potentially offending data to the unit tests for
Zend_Validate_Alnum, but I have been unable to reproduce the problem on
either of the two following platforms:
 
* PHP 5.1.4, WinXP, PCRE 6.6
 
* PHP 5.2.1, Ubuntu, PCRE 6.7
 
Are you on FreeBSD by chance?
 
Anyone else experiencing such a problem?
 
On another note, I would highly recommend upgrading your PHP beyond
5.2.0, which introduced some problems that have since been addressed in
later releases.
 
Best regards,
Darby
 
Graham Anderson wrote:
  
I updated against trunk and now...
 
require_once('Zend/Validate/Alnum.php');
 
$validator = new Zend_Validate_Alnum();
 
$vars = array (  'Alnum' => 'foobar1',
                         'NotAlnum' => 'foob@r1' );
 
foreach ( $vars as $var ) {
  echo $validator->isValid($var) ? $var .':true ' : $var . ':false ';
}
 
--
result: foobar1:false foob@r1:false
--
 
php5 -v
PHP 5.2.0 with Suhosin-Patch 0.9.6.1 (cli) (built: May  8 2007 20:00:45)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
    with Suhosin v0.9.10, (C) Copyright 2006, by Hardened-PHP Project
 
    
 
 
  




-- 
Andries Seutens
http://andries.systray.be
<Prev in Thread] Current Thread [Next in Thread>