summaryrefslogtreecommitdiff
path: root/addons/google_spreadsheet/models
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2017-05-12 17:14:52 +0200
committerXavier Morel <xmo@odoo.com>2017-05-15 12:26:31 +0200
commite2f1af78c465916551f12419f37d4e63a6cfd7f2 (patch)
tree64b5e6a05831bb5db4e32d241d90eedc2bedda7e /addons/google_spreadsheet/models
parent5617d4614b4644f0eaf2feb402f0066f260200c8 (diff)
[FIX] P3: remove cgi.escape uses
cgi.escape is unsafe (quote=False by default) and deprecated in Python 3. We already have an openerp.tools.misc.html_escape version which forwards to the (modern and safe) werkzeug.utils.escape, just use that everywhere, and convert extant uses of werkzeug.utils.escape to utils.html_escape as well so that we do the same thing everywhere.
Diffstat (limited to 'addons/google_spreadsheet/models')
-rw-r--r--addons/google_spreadsheet/models/google_drive.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/google_spreadsheet/models/google_drive.py b/addons/google_spreadsheet/models/google_drive.py
index dce4777a25e..08c0774cc83 100644
--- a/addons/google_spreadsheet/models/google_drive.py
+++ b/addons/google_spreadsheet/models/google_drive.py
@@ -1,6 +1,5 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-import cgi
import json
import logging
@@ -10,6 +9,7 @@ import re
import werkzeug.urls
from odoo import api, models
+from odoo.tools import misc
from odoo.addons.google_account import TIMEOUT
_logger = logging.getLogger(__name__)
@@ -70,7 +70,7 @@ class GoogleDrive(models.Model):
href="https://spreadsheets.google.com/feeds/cells/{key}/od6/private/full/R60C15"/>
<gs:cell row="60" col="15" inputValue="{config}"/>
</entry>
-</feed>''' .format(key=spreadsheet_key, formula=cgi.escape(formula, quote=True), config=cgi.escape(config_formula, quote=True))
+</feed>''' .format(key=spreadsheet_key, formula=misc.html_escape(formula), config=misc.html_escape(config_formula))
try:
req = requests.post(