Skip to content

Commit 9ab41c7

Browse files
committed
Bug #17725 Patch Avoid deprecated eregi functions
git-svn-id: https://svn.php.net/repository/pear/packages/XML_Parser/trunk@302733 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 7a09476 commit 9ab41c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ function setInputFile($file)
417417
/**
418418
* check, if file is a remote file
419419
*/
420-
if (eregi('^(http|ftp)://', substr($file, 0, 10))) {
420+
if (preg_match('/^(http|ftp):\/\//i', substr($file, 0, 10))) {
421421
if (!ini_get('allow_url_fopen')) {
422422
return $this->
423423
raiseError('Remote files cannot be parsed, as safe mode is enabled.',
@@ -474,7 +474,7 @@ function setInput($fp)
474474
if (is_resource($fp)) {
475475
$this->fp = $fp;
476476
return true;
477-
} elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) {
477+
} elseif (preg_match('/^[a-z]+:\/\//i', substr($fp, 0, 10))) {
478478
// see if it's an absolute URL (has a scheme at the beginning)
479479
return $this->setInputFile($fp);
480480
} elseif (file_exists($fp)) {

0 commit comments

Comments
 (0)