while ($dentry = $dir->read())
if ($dentry != "." && $dentry != ".." && is_file ($dirname . "/" . $dentry)
&& strstr ($dentry, ".tar.") !== false && substr ($dentry, -4, 4) != '.asc')
- $file[] = ereg_replace ("\.tar\.", ".tar.", $dentry);
+ $file[] = $dentry;
}
return $file;
}
$dir = dir ($dirname);
while ($dentry = $dir->read()) {
if ($dentry != "." && $dentry != ".." && is_file ($dirname . "/" . $dentry)) {
- if (ereg (".*-$version\.[^0-9].*", $dentry)) {
+ if (preg_match ("/.*-$version\.[^0-9].*/", $dentry)) {
$file[] = $dentry;
}
}
for ($i=0; ($i < count ($file)) && ($i < <get-var maxdownload>); $i++) {
# Correct the filename again...
- $file[$i] = ereg_replace ("\.0\.0\.0\.tar\.", ".tar.", $file[$i]);
$foo = strstr ($file[$i], ".tar.");
if ($foo) {
$name = substr ($file[$i], 0, (strlen ($file[$i]) - strlen ($foo)));
if ($copy) {
$version .= "-" . $token;
} else {
- if (ereg ("^[0-9][0-9a-zA-Z\.:]*", $token)) {
+ if (preg_match("/^[0-9][0-9a-zA-Z\.:]*/", $token)) {
$copy = 1;
$version = $token;
}
if ($copy) {
$version .= "-" . $token;
} else {
- if (ereg ("^[0-9][0-9a-zA-Z\.:]*", $token)) {
+ if (preg_match("/^[0-9][0-9a-zA-Z\.:]*/", $token)) {
$copy = 1;
$version = $token;
}
$file = get_tarfiles2 ("<download-dir>");
for ($i=0; $i < count ($file); $i++) {
- if (ereg (".*-<: print $version; :>\.tar\..*", $file[$i])) {
+ if (preg_match("/.*-<: print $version; :>\.tar\..*/", $file[$i])) {
printf ($fstr, $file[$i]);
}
}
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
if (strlen ($row['abstract'])) {
$rdate = $rdate[0];
$rtime = explode (":", $rtime);
$rtime = sprintf ("%s:%s", $rtime[0], $rtime[1]);
- $row['room'] = ereg_replace (" ", "+", $row['room']);
+ $row['room'] = str_replace (" ", "+", $row['room']);
printf ("<br> %s: <a href=\"workshop.php3?room=%s&day=%s&time=%s\">%s</a>",
$row['speaker'], $row['room'], $rdate, $rtime, $row['title']);
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
if (strlen ($row['abstract'])) {
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
if (strlen ($row['abstract'])) {
printf ("<h4>%s, %s</h4>", $dayname[$thisday], spokendate ($thisday));
}
if (strlen ($row['abstract'])) {
- $tr_room = ereg_replace (" ", "+", $row['room']);
+ $tr_room = str_replace (" ", "+", $row['room']);
$talk = sprintf ("<a href=\"workshop.php3?room=%s&day=%s&time=%s\">%s</a>",
$tr_room, $thisday, $rtime, $row['title']);
} else {
<?
function db_quote ($text)
{
- $text= ereg_replace ("'", "''", $text);
+ $text= str_replace ("'", "''", $text);
return $text;
}
$rdate = $rdate[0];
$rtime = explode (":", $rtime);
$rtime = sprintf ("%s:%s", $rtime[0], $rtime[1]);
- $row['room'] = ereg_replace (" ", "+", $row['room']);
+ $row['room'] = str_replace (" ", "+", $row['room']);
if (strlen ($row['abstract'])) {
printf ("<br> %s: <a href=\"workshop.php3?room=%s&day=%s&time=%s\">%s</a>",
}
} else {
# Check content negotiation
- if (ereg ("en.*de", $HTTP_ACCEPT_LANGUAGE)) {
+ if (preg_match("/en.*de/", $HTTP_ACCEPT_LANGUAGE)) {
$desc = 'description_en';
add_link("de");
} else {
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
$row['title'] = substr ($row['title'],0, <len_title>-3) . "...";
}
- if (strlen ($row['speaker']) > <len_speaker> && ereg (",", $row['speaker'])) {
+ if (strlen ($row['speaker']) > <len_speaker> && strpos($row['speaker'] !== false)) {
$foo = explode (",", $row['speaker']);
$row['speaker'] = $foo[0];
}
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
if (strlen ($row['abstract'])) {
$rdate = $rdate[0];
$rtime = explode (":", $rtime);
$rtime = sprintf ("%s:%s", $rtime[0], $rtime[1]);
- $row['room'] = ereg_replace (" ", "+", $row['room']);
+ $row['room'] = str_replace (" ", "+", $row['room']);
if (strlen ($row['abstract'])) {
printf ("<br> %s: <a href=\"workshop.php3?room=%s&day=%s&time=%s\">%s</a>",
}
} else {
# Check content negotiation
- if (ereg ("en.*de", $HTTP_ACCEPT_LANGUAGE)) {
+ if (preg_match("/en.*de/", $HTTP_ACCEPT_LANGUAGE)) {
$desc = 'description_en';
add_link("de");
} else {
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
$row['title'] = substr ($row['title'],0, <len_title>-3) . "...";
}
- if (strlen ($row['speaker']) > <len_speaker> && ereg (",", $row['speaker'])) {
+ if (strlen ($row['speaker']) > <len_speaker> && strpos($row['speaker']) !== false) {
$foo = explode (",", $row['speaker']);
$row['speaker'] = $foo[0];
}
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
if (strlen ($row['abstract'])) {
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
$rdate = $rdate[0];
$rtime = explode (":", $rtime);
$rtime = sprintf ("%s:%s", $rtime[0], $rtime[1]);
- $row['room'] = ereg_replace (" ", "+", $row['room']);
+ $row['room'] = str_replace (" ", "+", $row['room']);
if (strlen ($row['abstract'])) {
printf ("<br> %s: <a href=\"workshop.php3?room=%s&day=%s&time=%s\">%s</a>",
}
} else {
# Check content negotiation
- if (ereg ("en.*de", $HTTP_ACCEPT_LANGUAGE)) {
+ if (preg_match("/en.*de/", $HTTP_ACCEPT_LANGUAGE)) {
$desc = 'description_en';
add_link("de");
} else {
printf ($t_time, $thistime);
for ($thisroom=$room[0],$roomcount=1; $roomcount<=count($room); $thisroom=$room[$roomcount++]) {
- $tr_room = ereg_replace (" ", "+", $thisroom);
+ $tr_room = str_replace (" ", "+", $thisroom);
if (($rdate == $thisday) && ($rtime == $thistime) && ($row['room'] == $thisroom)) {
if ($row['visible'] == 1) {
$year = $thisyear;
}
- $row['name'] = ereg_replace (" ", " ", $row['name']);
- $row['country'] = ereg_replace (" ", " ", $row['country']);
+ $row['name'] = str_replace (" ", " ", $row['name']);
+ $row['country'] = str_replace (" ", " ", $row['country']);
$name = encode_name ($row, "debian");
$year = $thisyear;
}
- $row['name'] = ereg_replace (" ", " ", $row['name']);
- $row['country'] = ereg_replace (" ", " ", $row['country']);
+ $row['name'] = str_replace (" ", " ", $row['name']);
+ $row['country'] = str_replace (" ", " ", $row['country']);
$name = encode_name ($row, "debian");
$year = $thisyear;
}
- $row['name'] = ereg_replace (" ", " ", $row['name']);
- $row['city'] = ereg_replace (" ", " ", $row['city']);
- $row['country'] = ereg_replace (" ", " ", $row['country']);
+ $row['name'] = str_replace (" ", " ", $row['name']);
+ $row['city'] = str_replace (" ", " ", $row['city']);
+ $row['country'] = str_replace (" ", " ", $row['country']);
$name = encode_name ($row, "debian");
while (!feof ($f)) {
$line = fgets ($f, 255);
<protect>
- if (ereg ("^ ([a-z][^ ]*)@lists.debian.org", $line)) {
+ if (preg_match("/^ ([a-z][^ ]*)@lists.debian.org/", $line, $matches))
+ $lists[] = $matches[1];
</protect>
- $line = ereg_replace (" ", "", $line);
- $line = ereg_replace ("@.*", "", $line);
- $lists[] = $line;
- }
}
}
}
$color = "<cold>";
for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
$row = pg_fetch_array ($sth, $nr);
- $pkg = ereg_replace(" ", "%20", $row[0]);
+ $pkg = str_replace(" ", "%20", $row[0]);
$color = $color == "<cold>"?"<coln>":"<cold>";
printf ($trow, $color, $pkg, $row[0], $row[1]);
$color = "<cold>";
for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
$row = pg_fetch_array ($sth, $nr);
- $pkg = ereg_replace(" ", "%20", $row[0]);
+ $pkg = str_replace(" ", "%20", $row[0]);
$color = $color == "<cold>"?"<coln>":"<cold>";
printf ($trow, $color, $pkg, $row[0], $row[1]);
$color = "<cold>";
for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
$row = pg_fetch_array ($sth, $nr);
- $pkg = ereg_replace(" ", "%20", $row[0]);
+ $pkg = str_replace(" ", "%20", $row[0]);
$color = $color == "<cold>"?"<coln>":"<cold>";
printf ($trow, $color, $pkg, $row[0], $row[1]);
$year = $thisyear;
}
- $row['name'] = ereg_replace (" ", " ", $row['name']);
- $row['country'] = ereg_replace (" ", " ", $row['country']);
+ $row['name'] = str_replace (" ", " ", $row['name']);
+ $row['country'] = str_replace (" ", " ", $row['country']);
$name = encode_name ($row, "infodrom");
$year = $thisyear;
}
- $row['name'] = ereg_replace (" ", " ", $row['name']);
- $row['country'] = ereg_replace (" ", " ", $row['country']);
+ $row['name'] = str_replace (" ", " ", $row['name']);
+ $row['country'] = str_replace (" ", " ", $row['country']);
$name = encode_name ($row, "infodrom");
$date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
$ticker = $tick[$row['ticker']];
- $body = ereg_replace ("<newline>", "
-", ereg_replace ("<newline><newline>","<p>", ereg_replace ("
-", "<newline>", $row['body'])));
+ $body = str_replace("\n\n", "<p>", $row['body']);
printf ($format, $row['subject'], $date, $ticker, $body);
die("You are not allowed to edit this user.");
}
- if (ereg ("^[0-9]+$", $id)) {
+ if (preg_match("/^[0-9]+$/", $id)) {
$query = sprintf("SELECT * from person WHERE id = %d", $id);
} else {
die ("ID must be numeric");
// If not, we will try to find out the project of this user
- if (ereg ("^[0-9]+$", $id)) {
+ if (preg_match("/^[0-9]+$/", $id)) {
$query = sprintf ("SELECT junction.project FROM junction,person "
."WHERE person = id AND id=%d",
$id);
{
$fromto = explode ("-", $timeframe);
- if (!ereg ("([0-9]+)[\.:]([0-9]+)", $fromto[0], $frompart)) {
+ if (!preg_match("/([0-9]+)[\.:]([0-9]+)/", $fromto[0], $frompart)) {
$frompart[1] = $fromto[0];
$frompart[2] = 0;
}
$from = sprintf ("%02d:%02d", $frompart[1], $frompart[2]);
if (strlen ($fromto[1])) {
- if (!ereg ("([0-9]+)[\.:]([0-9]+)", $fromto[1], $to)) {
+ if (!preg_match("/([0-9]+)[\.:]([0-9]+)/", $fromto[1], $to)) {
$to[1] = $fromto[1];
$to[2] = 0;
}
<?
function strip_space($foo)
{
- return ereg_replace (" ", "_", $foo);
+ return str_replace (" ", "_", $foo);
}
?>
function build_appendix ($phone, $mobile, $comment)
{
$appendix = '';
- if (strlen ($phone) && ereg ("(\+[0-9]+ [0-9]+ [0-9]+)", $phone, $r)) {
+ if (strlen($phone) && preg_match("/(\+[0-9]+ [0-9]+ [0-9]+)/", $phone, $r))
$appendix = $r[1];
- }
- if (strlen ($mobile) && ereg ("(\+[0-9]+ [0-9]+ [0-9]+)", $mobile, $r)) {
+ if (strlen($mobile) && preg_match(/"(\+[0-9]+ [0-9]+ [0-9]+)/", $mobile, $r)) {
if (strlen ($appendix)){
$appendix .= "/".$r[1];
} else {
function email_ok($email)
{
- if (eregi('^[a-z0-9+.=-]+@[a-z0-9.-]+$', $email)) {
+ if (preg_match('/^[a-z0-9+.=-]+@[a-z0-9.-]+$/', $email)) {
return true;
} else {
return false;
$months = array ();
while ($dentry = $dir->read()) {
- if ($dentry != "." && $dentry != ".." && is_dir ("$dirname/$dentry") && ereg ("^[01][0-9]$", $dentry)) {
+ if ($dentry == "." || $dentry == "..") continue;
+ if (is_dir ("$dirname/$dentry") && preg_match('/^[01][0-9]$/', $dentry))
$months[] = $dentry;
}
}
printf ("<div class=\"newsbody\">Von <a href=\"mailto:%s\">%s</a>, %s</div>", $row['email'], $row['author'], $date);
printf ("<div class=\"newsbody\"><strong>%s</strong></div>\n", $row['teaser']);
echo ("<div class=\"newsbody\">");
- echo ereg_replace ("<newline>", "
-", ereg_replace ("<newline><newline>","<p>", ereg_replace ("
-", "<newline>", str_replace ("\\\n", "", str_replace ("\r", "", $row['body'])))));
+
+ echo str_replace(array("\r", "\\\n", "\n\n"),
+ array('', '', '<p>'),
+ $row['body']);
echo ("</div></div>");
}
}