]> source.dussan.org Git - nextcloud-server.git/commitdiff
Calendar: Bugfix: better input validation
authorGeorg Ehrke <ownclouddev@georgswebsite.de>
Thu, 2 Feb 2012 14:01:05 +0000 (15:01 +0100)
committerGeorg Ehrke <ownclouddev@georgswebsite.de>
Thu, 2 Feb 2012 14:01:05 +0000 (15:01 +0100)
apps/calendar/ajax/createcalendar.php
apps/calendar/ajax/events.php
apps/calendar/ajax/updatecalendar.php
apps/calendar/js/calendar.js
apps/calendar/templates/part.eventform.php

index b719b207c742aabdbf17e769f3e3ae7646610fc1..08bf7b4ee493940a8235b43e4bd42f4059d03605 100644 (file)
@@ -25,7 +25,7 @@ foreach($calendars as $cal){
 }
 
 $userid = OC_User::getUser();
-$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
+$calendarid = OC_Calendar_Calendar::addCalendar($userid, htmlspecialchars($_POST['name']), 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
 OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
 
 $calendar = OC_Calendar_Calendar::find($calendarid);
index 998991c2fb423b8e0e81798069800788428e9e56..75fac6838d7a27d12b42d6491fbdd697429f05f9 100644 (file)
@@ -11,8 +11,8 @@ require_once('../../../3rdparty/when/When.php');
 
 function addoutput($event, $vevent, $return_event){
        $return_event['id'] = (int)$event['id'];
-       $return_event['title'] = $event['summary'];
-       $return_event['description'] = isset($vevent->DESCRIPTION)?$vevent->DESCRIPTION->value:'';
+       $return_event['title'] = htmlspecialchars($event['summary']);
+       $return_event['description'] = isset($vevent->DESCRIPTION)?htmlspecialchars($vevent->DESCRIPTION->value):'';
        $last_modified = $vevent->__get('LAST-MODIFIED');
        if ($last_modified){
                $lastmodified = $last_modified->getDateTime()->format('U');
index 269b7b7ca06f3911c1754fdff99fba521b839097..90dafd35b68c9f865288f6273f5bb903316df31d 100644 (file)
@@ -26,7 +26,7 @@ foreach($calendars as $cal){
 
 $calendarid = $_POST['id'];
 $calendar = OC_Calendar_App::getCalendar($calendarid);//access check
-OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], null, null, null, $_POST['color']);
+OC_Calendar_Calendar::editCalendar($calendarid, htmlspecialchars($_POST['name']), null, null, null, $_POST['color']);
 OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
 
 $calendar = OC_Calendar_App::getCalendar($calendarid);
index afd1b692dd422e02a1e5bbbbb8ceb3661c291bf0..64c029404cba8a2d9c344c836d4150a2b8ab754d 100644 (file)
@@ -698,6 +698,7 @@ $(document).ready(function(){
                eventDrop: Calendar.UI.moveEvent,
                eventResize: Calendar.UI.resizeEvent,
                eventRender: function(event, element) {
+                       element.find('span.fc-event-title').html(element.find('span.fc-event-title').text());
                        element.tipsy({
                                className: 'tipsy-event',
                                opacity: 0.9,
index 1f2073f4bc7c92e1008dfff3b864219836e385ed..49214aca77cd8c63a65bca5374826649cf5c9936 100644 (file)
@@ -2,7 +2,7 @@
                <tr>
                        <th width="75px"><?php echo $l->t("Title");?>:</th>
                        <td>
-                               <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Title of the Event");?>" value="<?php echo isset($_['title']) ? $_['title'] : '' ?>" maxlength="100" name="title"/>
+                               <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Title of the Event");?>" value="<?php echo isset($_['title']) ? htmlspecialchars($_['title']) : '' ?>" maxlength="100" name="title"/>
                        </td>
                </tr>
        </table>
                        <tr>
                                <th width="85px"><?php echo $l->t("Location");?>:</th>
                                <td>
-                                       <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Location of the Event");?>" value="<?php echo isset($_['location']) ? $_['location'] : '' ?>" maxlength="100"  name="location" />
+                                       <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Location of the Event");?>" value="<?php echo isset($_['location']) ? htmlspecialchars($_['location']) : '' ?>" maxlength="100"  name="location" />
                                </td>
                        </tr>
                </table>
                        <tr>
                                <th width="85px" style="vertical-align: top;"><?php echo $l->t("Description");?>:</th>
                                <td>
-                                       <textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo isset($_['description']) ? $_['description'] : '' ?></textarea>
+                                       <textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo isset($_['description']) ? htmlspecialchars($_['description']) : '' ?></textarea>
                                </td>
                        </tr>
                </table>