Bug #862: problem in eregi()
| From: | markjr at easyDNS dot com | Date: | Tue, 20 Oct 1998 21:17:33 +0000 |
| Subject: | Bug #862: problem in eregi() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1925@lists.php.net to get a copy of this message | ||
From: markjr@easyDNS.com
Operating system: linux 2.0.35
PHP version: 3.0.5
PHP Bug Type: Misbehaving function
Bug description: problem in eregi()
eregi("[^a-z0-9\.\-]", "test-ing") returns false
eregi("[^a-z0-9\-\.]", "test-ing") returns true
Switching the escaped "." and "-" causes the
pattern to fail erroneously. The behaviour goes
away if you use an inclusive regex (read:
lose the "^")
here's a short script to test with
<?
function isValidAddr ($addr) {
if(eregi("[^a-z0-9\-\.]",$addr)):
return(false);
else:
return(true);
endif;
};
echo isValidAddr("Tesdt-jkjk") ? "true" : "false";
?>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net