Commit 40b9f07f authored by Sebastien Robin's avatar Sebastien Robin

check phone number before sending

git-svn-id: https://svn.erp5.org/repos/experimental@1951 bc57dcba-3610-0410-ab4f-dc20bb96b918
parent d330aa28
......@@ -95,7 +95,10 @@ class EssendexGateway(XMLObject):
security.declarePrivate("_transformPhoneUrlToGatewayNumber")
def _transformPhoneUrlToGatewayNumber(self,phone):
"""Transform url of phone number to a valid phone number (gateway side)"""
return phone.replace('tel:', '').replace('+','').replace('(0)','').replace('-','')
phone = phone.replace('tel:', '').replace('+','').replace('(0)','').replace('-','')
# Check that phone number can not be something not existing
assert not(phone.startwith('99000'))
return phone
security.declareProtected(Permissions.ManagePortal, 'send')
def send(self, text,recipient,sender=None, message_type="text",test=False,**kw):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment