added addslashes to title, content, answer and response fields to help deal with quotes after a clean_param()

This commit is contained in:
michaelpenne
2005-05-03 21:16:30 +00:00
parent 2c27cd193e
commit af9f2c05db
2 changed files with 15 additions and 1 deletions
+8
View File
@@ -42,6 +42,8 @@
/// CDC-FLAG ///
$newpage->title = clean_param($form->title, PARAM_CLEANHTML);
$newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML);
$newpage->title = addslashes($newpage->title);
$newpage->contents = addslashes($newpage->contents);
$newpageid = insert_record("lesson_pages", $newpage);
if (!$newpageid) {
error("Insert page: new page not inserted");
@@ -85,6 +87,8 @@
/// CDC-FLAG ///
$newpage->title = clean_param($form->title, PARAM_CLEANHTML);
$newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML);
$newpage->title = addslashes($newpage->title);
$newpage->contents = addslashes($newpage->contents);
$newpageid = insert_record("lesson_pages", $newpage);
if (!$newpageid) {
error("Insert page: new first page not inserted");
@@ -115,6 +119,8 @@
/// CDC-FLAG ///
$newpage->title = clean_param($form->title, PARAM_CLEANHTML);
$newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML);
$newpage->title = addslashes($newpage->title);
$newpage->contents = addslashes($newpage->contents);
$newpageid = insert_record("lesson_pages", $newpage);
if (!$newpageid) {
error("Insert page: first page not inserted");
@@ -152,8 +158,10 @@
$newanswer->pageid = $newpageid;
$newanswer->timecreated = $timenow;
$newanswer->answer = clean_param(trim($form->answer[$i]), PARAM_CLEANHTML);
$newanswer->answer = addslashes($newanswer->answer);
if (isset($form->response[$i])) {
$newanswer->response = clean_param(trim($form->response[$i]), PARAM_CLEANHTML);
$newanswer->response = addslashes($newanswer->response);
}
if (isset($form->jumpto[$i])) {
$newanswer->jumpto = clean_param($form->jumpto[$i], PARAM_INT);