diff options
author | Daniel Lange <DLange@git.local> | 2017-02-20 18:12:46 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2017-02-20 18:12:46 +0100 |
commit | 335d3c5c9c0b24ff5e07cd1968236a8dbc4f2c70 (patch) | |
tree | 6dfb123b3ff27b46bcdf9ef9acf8fa41bffec946 /functions/parse | |
parent | 7a4da3f67cb891cd5408bb4b511a54ccf9662485 (diff) | |
download | phpicalendar-335d3c5c9c0b24ff5e07cd1968236a8dbc4f2c70.tar.gz phpicalendar-335d3c5c9c0b24ff5e07cd1968236a8dbc4f2c70.tar.bz2 phpicalendar-335d3c5c9c0b24ff5e07cd1968236a8dbc4f2c70.zip |
PHP 7 compatibility from Sourceforge #680
Diffstat (limited to 'functions/parse')
-rw-r--r-- | functions/parse/end_vevent.php | 20 | ||||
-rw-r--r-- | functions/parse/parse_tzs.php | 6 | ||||
-rw-r--r-- | functions/parse/recur_functions.php | 4 |
3 files changed, 15 insertions, 15 deletions
diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php index 7def602..a44fca0 100644 --- a/functions/parse/end_vevent.php +++ b/functions/parse/end_vevent.php @@ -124,7 +124,7 @@ foreach ($rrule_array as $key => $val) { case 'UNTIL': # UNTIL must be in UTC $until = date("YmdHis",strtotime($val)); - ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})', $until, $regs); + preg_match ('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/', $until, $regs); $until_unixtime = mktime($regs[4],@$regs[5],@$regs[6],$regs[2],$regs[3],$regs[1]); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = localizeDate($dateFormat_week,$until); break; @@ -135,39 +135,39 @@ foreach ($rrule_array as $key => $val) { } break; case 'BYSECOND': - $bysecond = split (',', $val); + $bysecond = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $bysecond; break; case 'BYMINUTE': - $byminute = split (',', $val); + $byminute = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $byminute; break; case 'BYHOUR': - $byhour = split (',', $val); + $byhour = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $byhour; break; case 'BYDAY': - $byday = split (',', $val); + $byday = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $byday; break; case 'BYMONTHDAY': - $bymonthday = split (',', $val); + $bymonthday = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $bymonthday; break; case 'BYYEARDAY': - $byyearday = split (',', $val); + $byyearday = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $byyearday; break; case 'BYWEEKNO': - $byweekno = split (',', $val); + $byweekno = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $byweekno; break; case 'BYMONTH': - $bymonth = split (',', $val); + $bymonth = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $bymonth; break; case 'BYSETPOS': - $bysetpos = split (',', $val); + $bysetpos = explode (',', $val); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = $bysetpos; break; case 'WKST': diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php index 2e10834..348fe7e 100644 --- a/functions/parse/parse_tzs.php +++ b/functions/parse/parse_tzs.php @@ -12,12 +12,12 @@ $is_std = false; while (!feof($ifile)) { $line = $nextline; $nextline = fgets($ifile, 1024); - $nextline = ereg_replace("[\r\n]", '', $nextline); + $nextline = preg_replace("/[\r\n]/", '', $nextline); #handle continuation lines that start with either a space or a tab (MS Outlook) while (isset($nextline{0}) && ($nextline{0} == ' ' || $nextline{0} == "\t")) { $line = $line . substr($nextline, 1); $nextline = fgets($ifile, 1024); - $nextline = ereg_replace("[\r\n]", '', $nextline); + $nextline = preg_replace("/[\r\n]/", '', $nextline); } $line = trim($line); switch ($line) { @@ -56,7 +56,7 @@ while (!feof($ifile)) { break; default: unset ($field, $data, $prop_pos, $property); - if (ereg ('([^:]+):(.*)', $line, $line)){ + if (preg_match ('/([^:]+):(.*)/', $line, $line)){ $field = $line[1]; $data = $line[2]; $property = strtoupper($field); diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php index 82e9568..8bce9fe 100644 --- a/functions/parse/recur_functions.php +++ b/functions/parse/recur_functions.php @@ -138,7 +138,7 @@ function expand_byday($time) { [2] => 4 number [3] => TH day abbr */ - ereg ('([-\+]{0,1})?([0-9]+)?([A-Z]{2})', $day, $byday_arr); + preg_match ('/([-\+]{0,1})?([0-9]+)?([A-Z]{2})/', $day, $byday_arr); $on_day = two2threeCharDays($byday_arr[3]); switch ($freq_type) { case 'week': @@ -254,7 +254,7 @@ function restrict_byday($times, $freq = '') { [2] => 4 number [3] => TH day abbr */ - ereg ('([-\+]{0,1})?([0-9]{1})?([A-Z]{2})', $day, $byday_arr); + preg_match ('/([-\+]{0,1})?([0-9]{1})?([A-Z]{2})/', $day, $byday_arr); $byday3[] = two2threeCharDays($byday_arr[3]); } $new_times = array(); |