[www-doc] [Git][VideoLAN.org/websites][master] 2 commits: Replace ereg* deprecated functions with preg* ones

Simon Latapie gitlab at videolan.org
Fri Feb 9 20:13:59 CET 2018


Simon Latapie pushed to branch master at VideoLAN organization / websites


Commits:
56572b84 by Simon Latapie at 2018-02-09T20:11:19+01:00
Replace ereg* deprecated functions with preg* ones

- - - - -
a3910a60 by Simon Latapie at 2018-02-09T20:13:31+01:00
Merge branch 'master' of https://code.videolan.org/VideoLAN.org/websites

- - - - -


4 changed files:

- www.videolan.org/include/magpierss/rss_parse.inc
- www.videolan.org/include/news.php
- www.videolan.org/news-rss.php
- www.videolan.org/videolan/team/index.php


Changes:

=====================================
www.videolan.org/include/magpierss/rss_parse.inc
=====================================
--- a/www.videolan.org/include/magpierss/rss_parse.inc
+++ b/www.videolan.org/include/magpierss/rss_parse.inc
@@ -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;


=====================================
www.videolan.org/include/news.php
=====================================
--- a/www.videolan.org/include/news.php
+++ b/www.videolan.org/include/news.php
@@ -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];


=====================================
www.videolan.org/news-rss.php
=====================================
--- a/www.videolan.org/news-rss.php
+++ b/www.videolan.org/news-rss.php
@@ -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];


=====================================
www.videolan.org/videolan/team/index.php
=====================================
--- a/www.videolan.org/videolan/team/index.php
+++ b/www.videolan.org/videolan/team/index.php
@@ -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));
       } 
    }



View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/compare/ba2a857d49703562d0bfd0d1c898693ecfa094d1...a3910a60f2299df7a24eac3dc397bc05189b8931

---
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/compare/ba2a857d49703562d0bfd0d1c898693ecfa094d1...a3910a60f2299df7a24eac3dc397bc05189b8931
You're receiving this email because of your account on code.videolan.org.


More information about the www-doc mailing list