From 335d3c5c9c0b24ff5e07cd1968236a8dbc4f2c70 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 20 Feb 2017 18:12:46 +0100 Subject: PHP 7 compatibility from Sourceforge #680 --- functions/template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'functions/template.php') diff --git a/functions/template.php b/functions/template.php index 17994da..c37ba56 100644 --- a/functions/template.php +++ b/functions/template.php @@ -93,8 +93,8 @@ class Page { $location = sanitizeForWeb(stripslashes(urldecode($new_val2['location']))); $description = sanitizeForWeb(stripslashes(urldecode($new_val2['description']))); if (!empty($description)) { - $description = ereg_replace('(blocked)?([[:alpha:]]+://([^<>&[:space:]]|&)+[[:alnum:]/])', '\2', $description); - $description = ereg_replace('(blocked)?(mailto:)?([[:alnum:]_.%+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,4})', '\3', $description); + $description = preg_replace('(blocked)?([[:alpha:]]+://([^<>&[:space:]]|&)+[[:alnum:]/])', '\2', $description); + $description = preg_replace('(blocked)?(mailto:)?([[:alnum:]_.%+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,4})', '\3', $description); } $event_start = $new_val2['event_start']; @@ -395,7 +395,7 @@ class Page { $key = mktime($regs_tmp[1],$regs_tmp[2],0,$this_month,$this_day,$this_year); $key = date ($timeFormat, $key); - if (ereg('([0-9]{1,2}):00', $key)) { + if (preg_match('/([0-9]{1,2}):00/', $key)) { $even_row = '2'; # column of times colspan = 4 to cover navigation links at top $weekdisplay .= ''; @@ -408,7 +408,7 @@ class Page { $weekdisplay .= ''; } else { $even_row = ''; - if (ereg('([0-9]{1,2}):30', $key)) $even_row = '3'; + if (preg_match('/([0-9]{1,2}):30/', $key)) $even_row = '3'; # empty row for each gridLength, to the right of times and left of first weekday $weekdisplay .= ''; $weekdisplay .= ''; @@ -1142,7 +1142,7 @@ HEREDOC; } - function Page($file = 'std.tpl') { + function __construct($file = 'std.tpl') { global $phpiCal_config; if (!file_exists($file)){ #look for it in default if not found -- cgit v1.2.3