diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 15008e95..4714aae9 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -430,7 +430,7 @@ valuetypes = { ["Bitcoin"]), FieldValidator("Litecoin address", - r'^[LM3][a-km-zA-HJ-NP-Z1-9]{26,33}$', + r'^([LM3][a-km-zA-HJ-NP-Z1-9]{26,33}|ltc1[a-km-z0-9]{39})$', ["Litecoin"]), FieldValidator("Repo Type", diff --git a/tests/metadata.TestCase b/tests/metadata.TestCase index b340038b..04da68ec 100755 --- a/tests/metadata.TestCase +++ b/tests/metadata.TestCase @@ -128,7 +128,7 @@ class MetadataTest(unittest.TestCase): fdroidserver.metadata.warnings_action = 'error' - # some valid addresses (L, M, 3) + # some valid addresses (L, M, 3, segwit) self.assertIsNone( validator.check('LgeGrrrrJAxyXprrPrrBrrX5Qrrrrrrrrd', 'fake.app.id') ) @@ -136,6 +136,11 @@ class MetadataTest(unittest.TestCase): validator.check('MrrrrrrrJAxyXpanPtrrRAX5QHxvUJo8id', 'fake.app.id') ) self.assertIsNone(validator.check('3rereVr9rAryrranrrrrrAXrrHx', 'fake.app.id')) + self.assertIsNone( + validator.check( + 'ltc1q7euacwhn6ef99vcfa57mute92q572aqsc4c2j5', 'fake.app.id' + ) + ) # some invalid addresses (various special use/testnet addresses, invalid chars) self.assertRaises(