Browse Source

kivy: sanitize inputs

283
ThomasV 9 years ago
parent
commit
011ccc6e54
  1. 10
      gui/kivy/uix/screens.py

10
gui/kivy/uix/screens.py

@ -207,11 +207,15 @@ class SendScreen(CScreen):
def do_send(self): def do_send(self):
address = str(self.screen.address) address = str(self.screen.address)
amount = self.app.get_amount(self.screen.amount) if not bitcoin.is_address(address):
message = unicode(self.screen.message)
if not bitcoin.is_address(self.address):
self.app.show_error(_('Invalid Bitcoin Address') + ':\n' + address) self.app.show_error(_('Invalid Bitcoin Address') + ':\n' + address)
return return
try:
amount = self.app.get_amount(self.screen.amount)
except:
self.app.show_error(_('Invalid amount') + ':\n' + self.screen.amount)
return
message = unicode(self.screen.message)
fee = None fee = None
outputs = [('address', address, amount)] outputs = [('address', address, amount)]
self.app.password_dialog(self.send_tx, (outputs, fee, message)) self.app.password_dialog(self.send_tx, (outputs, fee, message))

Loading…
Cancel
Save