Happy New Year
[squirrelmail.git] / plugins / calendar / calendar.php
index 5616308c0c7402dfa1f0b25d91a0b38cfdcb5fb4..43e32acbd9da21cc61a6a7d29c46227616cae90b 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Displays the main calendar page (month view).
  *
- * @copyright 2002-2011 The SquirrelMail Project Team
+ * @copyright 2002-2022 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -110,15 +110,15 @@ function drawmonthview() {
             }
             if (isset($calendardata[$cdate])){
                 $i=0;
-                while ($calfoo = each($calendardata[$cdate])) {
-                    $calbar = $calendardata[$cdate][$calfoo['key']];
+                foreach ($calendardata[$cdate] as $key => $value) {
+                    $calbar = $calendardata[$cdate][$key];
                     // FIXME: how to display multiline task
-                    $title = '['. $calfoo['key']. '] ' .
-                        str_replace(array("\r","\n"),array(' ',' '),htmlspecialchars($calbar['message']));
+                    $title = '['. $key. '] ' .
+                        str_replace(array("\r","\n"),array(' ',' '),sm_encode_html_special_chars($calbar['message']));
                     // FIXME: link to nowhere
                     echo "<a href=\"#\" style=\"text-decoration:none; color: "
                         .($calbar['priority']==1 ? $color[1] : $color[6])
-                        ."\" title=\"$title\">".htmlspecialchars($calbar['title'])."</a><br />\n";
+                        ."\" title=\"$title\">".sm_encode_html_special_chars($calbar['title'])."</a><br />\n";
                     $i=$i+1;
                     if($i==2){
                         break;