aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-05-20 06:04:14 +0000
committerChad Little <clittle@users.sourceforge.net>2004-05-20 06:04:14 +0000
commit0f13e5bce5215322b438006ab50acb3ba16709c9 (patch)
treea10b0f77307d21a4fddf66b49c7f0aae8424df0a
parentfcba93441ad7a97698f24f39c987b59ea1437e74 (diff)
downloadphpicalendar-0f13e5bce5215322b438006ab50acb3ba16709c9.tar.gz
phpicalendar-0f13e5bce5215322b438006ab50acb3ba16709c9.tar.bz2
phpicalendar-0f13e5bce5215322b438006ab50acb3ba16709c9.zip
More ereg to preg_match speed tweeks.
-rw-r--r--functions/draw_functions.php4
-rw-r--r--functions/ical_parser.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/functions/draw_functions.php b/functions/draw_functions.php
index f84b5c2..2df0f37 100644
--- a/functions/draw_functions.php
+++ b/functions/draw_functions.php
@@ -4,7 +4,7 @@
function drawEventTimes ($start, $end) {
global $gridLength;
- ereg ("([0-9]{2})([0-9]{2})", $start, $time);
+ preg_match ('/([0-9]{2})([0-9]{2})/', $start, $time);
$sta_h = $time[1];
$sta_min = $time[2];
$sta_min = sprintf("%02d", floor($sta_min / $gridLength) * $gridLength);
@@ -13,7 +13,7 @@ function drawEventTimes ($start, $end) {
$sta_min = "00";
}
- ereg ("([0-9]{2})([0-9]{2})", $end, $time);
+ preg_match ('/([0-9]{2})([0-9]{2})/', $end, $time);
$end_h = $time[1];
$end_min = $time[2];
$end_min = sprintf("%02d", floor($end_min / $gridLength) * $gridLength);
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 8af8e03..e6301a5 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -204,7 +204,7 @@ foreach ($cal_filelist as $filename) {
}
if (isset($start_time) && $start_time != '') {
preg_match ('/([0-9]{2})([0-9]{2})/', $start_time, $time);
- preg_match ('([0-9]{2})([0-9]{2})', $end_time, $time2);
+ preg_match ('/([0-9]{2})([0-9]{2})/', $end_time, $time2);
if (isset($start_unixtime) && isset($end_unixtime)) {
$length = $end_unixtime - $start_unixtime;
} else {
@@ -212,7 +212,7 @@ foreach ($cal_filelist as $filename) {
}
$drawKey = drawEventTimes($start_time, $end_time);
- ereg ('([0-9]{2})([0-9]{2})', $drawKey['draw_start'], $time3);
+ preg_match ('/([0-9]{2})([0-9]{2})/', $drawKey['draw_start'], $time3);
$hour = $time3[1];
$minute = $time3[2];
}
@@ -949,7 +949,7 @@ foreach ($cal_filelist as $filename) {
foreach ($data as $exdata) {
$exdata = str_replace('T', '', $exdata);
$exdata = str_replace('Z', '', $exdata);
- ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})', $exdata, $regs);
+ preg_match ('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})/', $exdata, $regs);
$except_dates[] = $regs[1] . $regs[2] . $regs[3];
$except_times[] = $regs[4] . $regs[5];
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy