Skip to content

Commit e3cedd7

Browse files
committed
Made schedules save correctly if a non-course item has a quote, and also fixed rendering of double slashes
1 parent 1953ca7 commit e3cedd7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

api/schedule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ function renderSvg($svg, $id) {
321321
if(empty($_POST['data'])) {
322322
die(json_encode(array("error" => "argument", "msg" => "No schedule was provided", "arg" => "schedule")));
323323
}
324-
$_POST['data'] = html_entity_decode($_POST['data'], ENT_QUOTES);
325-
$json = stripslashes($_POST['data']);
324+
// This will be raw data since there is no more sanatize like there used to be in the old code
325+
$json = $_POST['data'];
326326

327327
// Make sure the object was successfully decoded
328328
$json = sanitize(json_decode($json, true));

assets/src/modules/sm/Schedule/directives/scheduleDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ angular.module('sm').directive('schedule', function($timeout, $filter) {
144144
courseNum = '';
145145
}
146146
this.scope.scheduleItems.push({
147-
title: course.title.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#039;/g, "\'"),
147+
title: course.title.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#039;/g, "\'").replace(/\\\\/,"\\"),
148148
content: {
149149
location: location,
150150
courseNum: courseNum,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "schedulemaker",
3-
"version": "3.0.21",
3+
"version": "3.0.22",
44
"private": true,
55
"description": "A course database lookup tool and schedule building web application for use at Rochester Institute of Technology.",
66
"main": "index.php",

0 commit comments

Comments
 (0)