From afe701ae59e3aa3107307048b24de5d8edf322be Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Mon, 30 Aug 2010 12:58:56 -0500 Subject: [PATCH] Validate the response while saving a new address --- www/extras/shop/cart.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/extras/shop/cart.js b/www/extras/shop/cart.js index e64b1c415..e92f2e188 100644 --- a/www/extras/shop/cart.js +++ b/www/extras/shop/cart.js @@ -300,6 +300,11 @@ var id = o.responseText, d = self.elements.dropdowns; + if (!id.match(/^[A-Za-z0-9_-]{22}$/)) { + alert('Error: bad response trying to save address.'); + return; + } + function updateOne(dropdown) { var opt = _.detect(dropdown.options, function (o) { return o.text === label;