[svn r19232] This fixes a bug that avoid to add a course with a quote in his title (in the ajax function)

skala
Noël Dieschburg 16 years ago
parent e7e6986fea
commit 353b47e5eb
  1. 5
      main/admin/add_courses_to_session.php

@ -115,8 +115,9 @@ function search_courses($needle)
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
$course_list = array(); $course_list = array();
while($course = Database :: fetch_array($rs)) { while($course = Database :: fetch_array($rs)) {
$course_list[] = $course['code']; $course_list[] = $course['code'];
$return .= '<a href="#" onclick="add_course_to_session(\''.$course['code'].'\',\''.$course['title'].' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />'; $course_title=str_replace("'","\'",$course_title);
$return .= '<a href="#" onclick="add_course_to_session(\''.$course['code'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />';
} }
} }
$_SESSION['course_list'] = $course_list; $_SESSION['course_list'] = $course_list;

Loading…
Cancel
Save