Skip to content

Commit 11bfee3

Browse files
committed
Fix various PHP 8.1 errors in template.php
1 parent f8d0377 commit 11bfee3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

functions/template.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ function get_vtodo() {
877877
878878
HEREDOC;
879879

880-
$todo .= '<a class="psf" title="' . @$title . '" href="#" onclick="openTodoInfo(' . $todo_popup_data_index . '); return false;">';
880+
$todo .= '<a class="psf" href="#" onclick="openTodoInfo(' . $todo_popup_data_index . '); return false;">';
881881
$todo_popup_data_index++;
882882
$vtodo_array = $todo;
883883

@@ -921,9 +921,11 @@ function get_vtodo() {
921921
}
922922
}
923923

924-
function draw_month($template_p, $offset = '+0', $type) {
924+
function draw_month($template_p, $offset, $type) {
925925
global $phpiCal_config, $getdate, $master_array, $this_year, $this_month, $dateFormat_month, $cal, $minical_view, $month_event_lines, $daysofweekreallyshort_lang, $daysofweekshort_lang, $daysofweek_lang, $timeFormat_small, $timeFormat;
926-
926+
if (!$offset) {
927+
$offset = '+0';
928+
}
927929
$unique_colors = $phpiCal_config->unique_colors;
928930
preg_match('!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!Uis', $template_p, $match1);
929931
preg_match('!<\!-- loop monthdays on -->(.*)<\!-- loop monthdays off -->!Uis', $template_p, $match2);
@@ -1041,7 +1043,7 @@ function draw_month($template_p, $offset = '+0', $type) {
10411043
#echo "<pre>";print_r($switch);echo "</pre>";
10421044

10431045
foreach ($switch as $tag => $data) {
1044-
$temp = str_replace('{'.$tag.'}', $data, $temp);
1046+
$temp = str_replace('{'.$tag.'}', (string) $data, $temp);
10451047
}
10461048
$middle .= $temp;
10471049

@@ -1181,7 +1183,7 @@ function replace_tags($tags = array()) {
11811183
}
11821184

11831185
// This replaces any tags
1184-
$this->page = str_replace('{' . strtoupper($tag) . '}', $data, $this->page);
1186+
$this->page = str_replace('{' . strtoupper($tag) . '}', (string) $data, $this->page);
11851187
}
11861188

11871189
else

0 commit comments

Comments
 (0)