mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 14:27:58 -05:00
Clean AuthorizeNetException message
Removes credit card number from exception error message to make sure it doesn't show up in logs
This commit is contained in:
@@ -48,7 +48,16 @@ Errors = Storage(TESTMODE = "E00009",
|
||||
TOO_MANY_SHIP_ADDRESSES = "E00043")
|
||||
|
||||
class AuthorizeNetException(Exception):
|
||||
pass
|
||||
def __init__(self, msg):
|
||||
# don't let CC info show up in logs
|
||||
msg = re.sub("<cardNumber>\d+(\d{4})</cardNumber>",
|
||||
"<cardNumber>...\g<1></cardNumber>",
|
||||
msg)
|
||||
msg = re.sub("<cardCode>\d+</cardCode>",
|
||||
"<cardCode>omitted</cardCode>",
|
||||
msg)
|
||||
super(AuthorizeNetException, self).__init__(msg)
|
||||
|
||||
|
||||
|
||||
# xml tags whose content shouldn't be escaped
|
||||
|
||||
Reference in New Issue
Block a user