Commit 56572b84 authored by Simon Latapie's avatar Simon Latapie
Browse files

Replace ereg* deprecated functions with preg* ones

parent c57522cb
......@@ -150,7 +150,7 @@ class MagpieRSS {
// check for a namespace, and split if found
$ns = false;
if ( strpos( $element, ':' ) ) {
list($ns, $el) = split( ':', $element, 2);
list($ns, $el) = preg_split( '/:/', $element, 2);
}
if ( $ns and $ns != 'rdf' ) {
$this->current_namespace = $ns;
......
......@@ -40,13 +40,13 @@
while( !feof($file) )
{
$line=ereg_replace("\n","",fgets($file,4096));
$line=preg_replace("/\n/","",fgets($file,4096));
// Comments are allowed
if( !ereg("^ *#",$line) && !ereg("^ *$",$line) )
if( !preg_match("/^ *#/",$line) && !preg_match("/^ *$/",$line) )
{
// Topics start with "|"
if( ereg("^ *\|",$line) && $msg )
if( preg_match("/^ *\|/",$line) && $msg )
{
$ex=explode("|",$msg);
$date = $ex[1];
......
......@@ -25,13 +25,13 @@
while( !feof($file) )
{
$line=ereg_replace("\n","",fgets($file,4096));
$line=preg_replace("/\n/","",fgets($file,4096));
// Comments are allowed
if( !ereg("^ *#",$line) && !ereg("^ *$",$line) )
if( !preg_match("/^ *#/",$line) && !preg_match("/^ *$/",$line) )
{
// Topics start with "|"
if( ereg("^ *\|",$line) && $msg )
if( preg_match("/^ *\|/",$line) && $msg )
{
$ex=explode("|",$msg);
$date = $ex[1];
......
......@@ -33,10 +33,10 @@ part with '@'. </p>
global $count, $file;
if( $count >= count($file) ) return('');
$line = ereg_replace("\n", '',$file[$count]);
$line = preg_replace("/\n/", '',$file[$count]);
$count++;
if( ereg('^[ #]+', $line) ) return('');
if( preg_match('/^[ #]+/', $line) ) return('');
return htmlspecialchars($line);
}
......@@ -103,7 +103,7 @@ part with '@'. </p>
$handle=opendir('.');
while (false!=($f = readdir($handle))) {
if(ereg("AUTHORS.vlc", $f)) {
if(preg_match("/AUTHORS.vlc/", $f)) {
$file = file($f);
foreach( $file as $line ) {
?><p><?php
......@@ -111,7 +111,7 @@ part with '@'. </p>
?></p><?php
}
}
else if(ereg("AUTHORS",$f)) {
else if(preg_match("/AUTHORS/",$f)) {
parselist(substr($f,8));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment