Seriously? The variable is named as an array and initialized as a string? Well, I...
[squirrelmail.git] / plugins / calendar / day.php
index 220341ca86a3a1a2e4fa5b1da707c3d394e323a1..7dcafce9b5e9a8f520b7c445e333be5a07cd26d5 100644 (file)
@@ -3,18 +3,18 @@
 /**
  * Displays the day page (day view).
  *
- * @copyright © 2002-2006 The SquirrelMail Project Team
+ * @copyright 2002-2017 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage calendar
  */
 
-/** @ignore */
-define('SM_PATH','../../');
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../../include/init.php');
 
-/* SquirrelMail required files. */
-include_once(SM_PATH . 'include/validate.php');
 /* date_intl() */
 include_once(SM_PATH . 'functions/date.php');
 
@@ -126,10 +126,10 @@ function display_events() {
             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]\">".htmlspecialchars($calbar['title']).'</font>' : 
-                                htmlspecialchars($calbar['title']);
-                            echo'] <div style="margin-left:10px">'.nl2br(htmlspecialchars($calbar['message'])).'</div>' .
+                            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>' .
                         html_tag( 'td',
                             "<font size=\"-1\"><nobr>\n" .
                             "<a href=\"event_edit.php?year=$year&amp;month=$month&amp;day=$day&amp;hour=".
@@ -169,7 +169,7 @@ $calself=basename($PHP_SELF);
 
 $daily_events = array();
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 calendar_header();
 readcalendardata();
 day_header();
@@ -177,4 +177,4 @@ initialize_events();
 display_events();
 ?>
 </table></td></tr></table>
-</body></html>
\ No newline at end of file
+</body></html>