From: <pdo...@us...> - 2024-01-18 00:29:31
|
Revision: 15009 http://sourceforge.net/p/squirrelmail/code/15009 Author: pdontthink Date: 2024-01-18 00:29:29 +0000 (Thu, 18 Jan 2024) Log Message: ----------- PHP 8 fixes that never made their way into SVN Modified Paths: -------------- branches/SM-1_4-STABLE/squirrelmail/plugins/calendar/day.php Modified: branches/SM-1_4-STABLE/squirrelmail/plugins/calendar/day.php =================================================================== --- branches/SM-1_4-STABLE/squirrelmail/plugins/calendar/day.php 2024-01-02 22:42:19 UTC (rev 15008) +++ branches/SM-1_4-STABLE/squirrelmail/plugins/calendar/day.php 2024-01-18 00:29:29 UTC (rev 15009) @@ -80,8 +80,8 @@ $cdate = $month . $day . $year; if (isset($calendardata[$cdate])){ - while ( $calfoo = each($calendardata[$cdate])){ - $daily_events["$calfoo[key]"] = $calendardata[$cdate][$calfoo['key']]; + foreach ($calendardata[$cdate] as $key => $value){ + $daily_events[$key] = $calendardata[$cdate][$key]; } } } @@ -96,7 +96,7 @@ ksort($daily_events,SORT_STRING); $eo=0; - while ($calfoo = each($daily_events)){ + foreach ($daily_events as $key => $event){ if ($eo==0){ $eo=4; } else { @@ -103,23 +103,22 @@ $eo=0; } - $ehour = substr($calfoo['key'],0,2); - $eminute = substr($calfoo['key'],2,2); - if (!is_array($calfoo['value'])){ + $ehour = substr($key,0,2); + $eminute = substr($key,2,2); + if (!is_array($event)){ echo html_tag( 'tr', html_tag( 'td', $ehour . ':' . $eminute, 'left' ) . html_tag( 'td', ' ', 'left' ) . html_tag( 'td', "<font size=\"-1\"><a href=\"event_create.php?year=$year&month=$month&day=$day&hour=" - .substr($calfoo['key'],0,2)."\">". + .substr($key,0,2)."\">". _("ADD") . "</a></font>" , 'center' ) , '', $color[$eo]); } else { - $calbar=$calfoo['value']; - if ($calbar['length']!=0){ - $elength = '-'.date_intl(_("H:i"),mktime($ehour,$eminute+$calbar['length'],0,1,1,0)); + if ($event['length']!=0){ + $elength = '-'.date_intl(_("H:i"),mktime($ehour,$eminute+$event['length'],0,1,1,0)); } else { $elength=''; } @@ -126,17 +125,17 @@ echo html_tag( 'tr', '', '', $color[$eo] ) . html_tag( 'td', date_intl(_("H:i"),mktime($ehour,$eminute,0,1,1,0)) . $elength, 'left' ) . html_tag( 'td', '', 'left' ) . '['; - echo ($calbar['priority']==1) ? - "<font color=\"$color[1]\">".sm_encode_html_special_chars($calbar['title']).'</font>' : - sm_encode_html_special_chars($calbar['title']); - echo'] <div style="margin-left:10px">'.nl2br(sm_encode_html_special_chars($calbar['message'])).'</div>' . + echo ($event['priority']==1) ? + "<font color=\"$color[1]\">".sm_encode_html_special_chars($event['title']).'</font>' : + sm_encode_html_special_chars($event['title']); + echo'] <div style="margin-left:10px">'.nl2br(sm_encode_html_special_chars($event['message'])).'</div>' . html_tag( 'td', "<font size=\"-1\"><nobr>\n" . "<a href=\"event_edit.php?year=$year&month=$month&day=$day&hour=". - substr($calfoo['key'],0,2)."&minute=".substr($calfoo['key'],2,2)."\">". + substr($key,0,2)."&minute=".substr($key,2,2)."\">". _("EDIT") . "</a> | \n" . "<a href=\"event_delete.php?dyear=$year&dmonth=$month&dday=$day&dhour=". - substr($calfoo['key'],0,2)."&dminute=".substr($calfoo['key'],2,2). + substr($key,0,2)."&dminute=".substr($key,2,2). "&year=$year&month=$month&day=$day\">" . _("DEL") . '</a>' . "</nobr></font>\n" , @@ -177,4 +176,4 @@ display_events(); ?> </table></td></tr></table> -</body></html> \ No newline at end of file +</body></html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |