[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: www/media/includes
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2010-12-17 0:06:54
Message-ID: 20101217000654.2D513AC8A8 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1207101 by aacid:
port away from deprecated functions
ereg -> preg_match with s marker so that . also matches \n
eregi -> preg_match with i marker to get case insensitivity and s marker so that . \
also matches \n ereg_replace -> preg_replace
Using @ instead of the typical / marker in perl regexp since we use / more than @ in \
those regexps
CCMAIL: ingomalchow@googlemail.com
M +1 -1 classes/class_rdf.inc
M +5 -5 functions.inc
--- trunk/www/media/includes/classes/class_rdf.inc #1207100:1207101
@@ -18,7 +18,7 @@
if ($file) {
$rf = fread($file, 32000); // read 32K
- $grab = eregi('<item>(.*)</item>', $rf, $printing);
+ $grab = preg_match('@<item>(.*)</item>@is', $rf, $printing);
$rdf_pieces = explode("<item>", $printing[0]);
}
else echo "<b>" . i18n_var("Error while opening $rdf_file") . "</b>\n";
--- trunk/www/media/includes/functions.inc #1207100:1207101
@@ -118,9 +118,9 @@
{
$color = "newsbox2";
}
- ereg("<title>(.*)</title>", $rdf_pieces[$x], $title);
- ereg("<date>(.*)</date>", $rdf_pieces[$x], $date);
- ereg("<fullstory>(.*)</fullstory>", $rdf_pieces[$x], $fullstory);
+ preg_match("@<title>(.*)</title>@s", $rdf_pieces[$x], $title);
+ preg_match("@<date>(.*)</date>@s", $rdf_pieces[$x], $date);
+ preg_match("@<fullstory>(.*)</fullstory>@s", $rdf_pieces[$x], $fullstory);
print "<tr>\n";
$printDate = $date[1];
@@ -130,12 +130,12 @@
if ($summaryonly)
{
print "<td valign=\"top\" class=\"$color\">".(($printDate == $prevDate) ? \
" " : "<b>$printDate</b>")."</td>\n";
- print "<td class=\"$color\"><a href=\"news.php#item" . \
ereg_replace("[^a-zA-Z0-9]", "", $title[1]) . "\">$title[1]</a></td>\n"; + \
print "<td class=\"$color\"><a href=\"news.php#item" . preg_replace("@[^a-zA-Z0-9]@", \
"", $title[1]) . "\">$title[1]</a></td>\n"; $prevDate = $printDate;
}
else
{
- print "<td class=\"newsbox2\"><h3><a name=\"item" . \
ereg_replace("[^a-zA-Z0-9]", "", $title[1]) . "\">$printDate: \
$title[1]</a></h3></td>\n"; + print "<td class=\"newsbox2\"><h3><a \
name=\"item" . preg_replace("@[^a-zA-Z0-9]@", "", $title[1]) . "\">$printDate: \
$title[1]</a></h3></td>\n"; print "</tr><tr><td \
class=\"newsbox2\">$fullstory[1]</td>\n"; }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic