Update of /cvsroot/fink/web
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29650

Modified Files:
        header.inc package-updates.inc package-updates.php 
        phpLang.inc.php 
Log Message:
replace ereg with preg syntax


Index: package-updates.php
===================================================================
RCS file: /cvsroot/fink/web/package-updates.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- package-updates.php 15 Sep 2010 23:43:38 -0000      1.4
+++ package-updates.php 16 Sep 2010 19:42:35 -0000      1.5
@@ -21,7 +21,7 @@
 $count = 0;
 foreach($rss->getItems() as $item) {
        $date = $item['dc:date'];
-       $date = ereg_replace('T.*$', '', $date);
+       $date = preg_replace('|T.*$|', '', $date);
        echo "<a style=\"text-decoration: none\" href=\"" . 
htmlentities($item['link']) . "\" name=\"" . urlencode($item['title']) . 
"\"><span class=\"news-date\">" . $date . ": </span><span 
class=\"news-headline\" style=\"text-decoration: underline\">" . $item['title'] 
. "</span></a><br />\n";
        echo $item['description'];
 }

Index: package-updates.inc
===================================================================
RCS file: /cvsroot/fink/web/package-updates.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- package-updates.inc 15 Sep 2010 23:43:38 -0000      1.2
+++ package-updates.inc 16 Sep 2010 19:42:35 -0000      1.3
@@ -8,7 +8,7 @@
 $count = 0;
 foreach($rss->getItems() as $item) {
        $date = $item['dc:date'];
-       $date = ereg_replace('T.*$', '', $date);
+       $date = preg_replace('|T.*$|', '', $date);
        echo "<a style=\"text-decoration: none\" href=\"" . 
htmlentities($item['link']) . "\" name=\"" . urlencode($item['title']) . 
"\"><span class=\"news-date\">" . $date . ": </span><span 
class=\"news-headline\">" . $item['title'] . "</span></a><br />\n";
        if (++$count > 10) {
                break;

Index: header.inc
===================================================================
RCS file: /cvsroot/fink/web/header.inc,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- header.inc  15 Sep 2010 23:47:20 -0000      1.124
+++ header.inc  16 Sep 2010 19:42:35 -0000      1.125
@@ -151,12 +151,14 @@
 if (substr($cvs_date,0,1) == "$")
   $cvs_date = rtrim(substr($cvs_date, 1, -1));
 //  get data
-if (ereg("^Author: (.*)$", $cvs_author, $r)) {
+$myreg = "/^Author: (.*)$/";
+if (preg_match($myreg, $cvs_author, $r)) {
   $author = $r[1];
 } else {
   $author = "-unknown-";
 }
-if (ereg("^Date: ([0-9]{2,4})[/-]([0-9]{1,2})[/-]([0-9]{1,2}) 
([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $cvs_date, $r)) {
+$myreg = "|^Date: ([0-9]{2,4})[/\-]([0-9]{1,2})[/\-]([0-9]{1,2}) 
([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})|";
+if (preg_match($myreg, $cvs_date, $r)) {
   $date = gmmktime($r[4], $r[5], $r[6], $r[2], $r[3], $r[1]);
   define ("FILEMDATE", (gmmktime($r[4], $r[5], $r[6], $r[2], $r[3], $r[1])));
 } else {
@@ -166,7 +168,7 @@
 }
 // converts xml style tag to html 4.01 transitional (ad hoc)
 if (!isset($metatags)) global $metatags;
-$metatags = ereg_replace('<([^/]*)/>', '<\1>', $metatags);
+$metatags = preg_replace('|<([^/]*)/>|', '|<\1>|', $metatags);
 
 // [translation] Function used in doc and faq for translation
 

Index: phpLang.inc.php
===================================================================
RCS file: /cvsroot/fink/web/phpLang.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- phpLang.inc.php     5 Sep 2010 16:11:54 -0000       1.21
+++ phpLang.inc.php     16 Sep 2010 19:42:35 -0000      1.22
@@ -112,16 +112,16 @@
 
 // finds current file name, extension and uri
 if (!isset($SCRIPT_NAME)) $SCRIPT_NAME = getenv('SCRIPT_NAME');
-if(ereg("([^/?]+)(\?.*)?$", $SCRIPT_NAME, $regs)) {
+if(preg_match("|([^/?]+)(\?.*)?$|", $SCRIPT_NAME, $regs)) {
        define('phpLang_currentFile', $regs[1]);
-       if(ereg("(.*)(\.[^.]+)$", phpLang_currentFile, $regs2)) {
+       if(preg_match("|(.*)(\.[^.]+)$|", phpLang_currentFile, $regs2)) {
                define('phpLang_currentFileName', $regs2[1]);
                define('phpLang_currentFileExtension', $regs2[2]);
        } else {
                define('phpLang_currentFileName', phpLang_currentFile);
        }
-       $uri = ereg_replace("[?&]".phpLang_urlParam."=[^&]*", "", $regs[0]);
-       $uri .= ereg("\?", $uri) ? '&' : '?';
+       $uri = preg_replace("|[?&]".phpLang_urlParam."=[^&]*|", "", $regs[0]);
+       $uri .= preg_match("|\?|", $uri) ? '&' : '?';
        define('phpLang_currentURI', $uri);
 } else {
        // it should not be possible
@@ -165,7 +165,7 @@
        $ext = '';
        reset($GLOBALS['phpLang_languages']);
        while($ext == '' && list($key, $name) = 
each($GLOBALS['phpLang_languages'])) {
-               if (($from == 1 && eregi("^".$key."$",$str)) || ($from == 2 && 
eregi("(\(|\[|;[[:space:]])".$key."(;|\]|\))",$str))) {
+               if (($from == 1 && preg_match("|^".$key."$|i", $str)) || ($from 
== 2 && preg_match("?(\(|\[|;[[:space:]])".$key."(;|\]|\))?i",$str))) {
                        $ext = $name[0];
                }
        }


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to