[Scummvm-git-logs] scummvm-web old-design -> f179ac2b218caa2ff65adb98fb04cd5b1b95fa20

Mataniko mataniko at gmail.com
Sat Apr 27 02:07:09 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
f179ac2b21 WEB: Fix old site to work with php7.0


Commit: f179ac2b218caa2ff65adb98fb04cd5b1b95fa20
    https://github.com/scummvm/scummvm-web/commit/f179ac2b218caa2ff65adb98fb04cd5b1b95fa20
Author: Matan Bareket (mataniko at gmail.com)
Date: 2019-04-26T20:05:29-04:00

Commit Message:
WEB: Fix old site to work with php7.0

Changed paths:
    include/util.php
    index.php


diff --git a/include/util.php b/include/util.php
index 72c67f2..18afca6 100644
--- a/include/util.php
+++ b/include/util.php
@@ -5,7 +5,7 @@
  * by Jeremy Newman <jnewman at dracowulf.com>
  *
  */
- 
+
 // format date
 function make_date ($time)
 {
@@ -46,11 +46,11 @@ function display_xml ($file, $mode = null)
     if (!$mode)
         return null;
     if (file_exists($file))
-    { 
+    {
       $fp = @fopen($file, "r");
       $data = fread($fp, filesize($file));
       @fclose($fp);
-      if (eregi("<" . $mode . ">(.*)</" . $mode . ">", $data, $out))
+      if (preg_match("/<" . $mode . ">(.*)</" . $mode . ">/i", $data, $out))
       {
 	  return $out[1];
       }
@@ -58,7 +58,7 @@ function display_xml ($file, $mode = null)
     else
     {
       return null;
-    }	
+    }
 }
 
 // get a list of files in a directory
@@ -71,16 +71,16 @@ function get_files ($dir, $filter = null)
     {
     	if ($filter)
 	{
-	    if(!eregi("(.+)\\.".$filter, $entry))
+	    if(!preg_match("/(.+)\\.".$filter ."/i", $entry))
 	        continue;
 	}
     	array_push($files, $entry);
     }
     closedir($d);
-    
+
     //sort dir
     sort($files);
-    
+
     return $files;
 }
 
diff --git a/index.php b/index.php
index fe9836a..446b79a 100644
--- a/index.php
+++ b/index.php
@@ -131,31 +131,32 @@ while (list($key,$item) = each($news))
 		@fclose($fp);
 
 		$news_date = "";
-		if (eregi("<DATE>(.*)</DATE>", $data, $out))
+		if (preg_match('/<DATE>(.*)<\/DATE>/i', $data, $out))
 		{
 			$news_date = $out[1];
 		}
 
+    //preg_match()
 		$news_author = "";
-		if (eregi("<AUTHOR>(.*)</AUTHOR>", $data, $out))
+		if (preg_match('/<AUTHOR>(.*)<\/AUTHOR>/i', $data, $out))
 		{
 			$news_author = "Posted by ".$out[1];
-		}
+    }
 
 		$news_title = "";
-		if (eregi("<NAME>(.*)</NAME>", $data, $out))
+		if (preg_match('/<NAME>(.*)<\/NAME>/i', $data, $out))
 		{
 			$news_title = $out[1];
 		}
 
 		$news_img = "";
-		if (eregi("<IMG>(.*)</IMG>", $data, $out))
+		if (preg_match('/<IMG>(.*)<\/IMG>/i', $data, $out))
 		{
 			$news_img = $out[1];
 		}
 
 		$news_body = "";
-		if (eregi("<BODY>(.*)</BODY>", $data, $out))
+		if (preg_match('/<BODY>(.*)<\/BODY>/is', $data, $out))
 		{
 			$news_body = $out[1];
 		}





More information about the Scummvm-git-logs mailing list