Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Provisional workaround to sanitize rating comments #323

Merged
merged 1 commit into from
Dec 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sagenb/flask_version/worksheet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import os, threading, collections
from functools import wraps
from flask import Module, make_response, url_for, render_template, request, session, redirect, g, current_app
from flask import Module, make_response, url_for, render_template, request, session, redirect, g, current_app, escape
from decorators import login_required, with_lock
from collections import defaultdict
from werkzeug.utils import secure_filename
Expand Down Expand Up @@ -920,7 +920,7 @@ def worksheet_rate(worksheet):
return current_app.message(_("Gees -- You can't fool the rating system that easily!"),
url_for_worksheet(worksheet))

comment = request.values['comment']
comment = str(escape(request.values['comment']))
worksheet.rate(rating, comment, g.username)
s = _("""
Thank you for rating the worksheet <b><i>%(worksheet_name)s</i></b>!
Expand Down