Permalink
Browse files

Bug #17784 Patch: Avoid ereg

git-svn-id: http://svn.php.net/repository/pear/packages/RDF/trunk@302670 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent ee490fd commit e08ca3934432f93d717550ee4b4645f387f22b5c @CloCkWeRX CloCkWeRX committed Aug 23, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 RDF/Parser.php
View
@@ -324,7 +324,7 @@ function _is_forbidden_rdf_node_element ($local_name)
*/
function _is_alnum($val)
{
- return ereg('[A-Za-z0-9]', $val);
+ return preg_match('/[A-Za-z0-9]/', $val);
}
/**
@@ -334,7 +334,7 @@ function _is_alnum($val)
*/
function _is_alpha($val)
{
- return ereg('[A-Za-z]', $val);
+ return preg_match('/[A-Za-z]/', $val);
}
/**
@@ -1864,7 +1864,7 @@ function _character_data_handler($parser, $s)
if ($this->rdf_parser['top']['state'] == RDF_IN_PROPERTY_UNKNOWN_OBJECT) {
/* look for non-whitespace */
- for ($i = 0; (($i < $len) && (ereg(" |\n|\t", $s{ $i }))); $i++);
+ for ($i = 0; (($i < $len) && (preg_match("/[ \n\t]/", $s{ $i }))); $i++);
/* if we found non-whitespace, this is a literal */
if ($i < $len) {
$this->rdf_parser['top']['state'] = RDF_IN_PROPERTY_LITERAL;

0 comments on commit e08ca39

Please sign in to comment.