cvs: pear /Validate/Validate US.php

From: Date: Wed, 19 Jun 2002 16:32:56 +0000
Subject: cvs: pear /Validate/Validate US.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4693@lists.php.net to get a copy of this message
busterb Wed Jun 19 12:32:56 2002 EDT Modified files: /pear/Validate/Validate US.php Log: Revert file handling patch; having a big dependency for such a small, static function is overkill. Index: pear/Validate/Validate/US.php diff -u pear/Validate/Validate/US.php:1.4 pear/Validate/Validate/US.php:1.5 --- pear/Validate/Validate/US.php:1.4 Wed Jun 19 11:41:42 2002 +++ pear/Validate/Validate/US.php Wed Jun 19 12:32:56 2002 @@ -17,7 +17,7 @@ // | Tim Gallagher <timg@sunflowerroad.com> | // +----------------------------------------------------------------------+ // -// $Id: US.php,v 1.4 2002/06/19 15:41:42 busterb Exp $ +// $Id: US.php,v 1.5 2002/06/19 16:32:56 busterb Exp $ // // Specific validation methods for data used in the United States // @@ -139,11 +139,15 @@ $is_text = false) { if (!$is_text) { - $source = File::readAll($uri); - if (PEAR::isError($source)) { - return PEAR::raiseError('Could not access the SSA High Groups file: ' . $uri); - return $source; + if (!$fd = @fopen($source, 'r')) { + trigger_error("Could not access the SSA High Groups file", E_USER_WARNING); + return array(); } + $source = ''; + while ($data = fread($fd, 2048)) { + $source .= $data; + } + fclose($fd); } $search = array ("'<script[^>]*?>.*?</script>'si", // Strip javascript

« previous php.pear.cvs (#4693) next »