summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-18 03:57:17 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-18 03:57:17 -0700
commitdfeb43ed8472608961b37bc69f19222abb4c8f1a (patch)
treed46be9c6768066cff893031e7d403faff3909eb8
parentce0af6938441d6018ac8fde9fc1834ef73b75534 (diff)
Even cleaner PLMN support.
-rw-r--r--MobileCydia.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 471299c..f57d5f1 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -10232,8 +10232,13 @@ int main(int argc, char *argv[]) {
if (mcc != NULL && mnc != NULL)
if (CFStringGetLength(mcc) == 3) {
CFIndex length(CFStringGetLength(mnc));
- if (length == 2 || length == 3)
+ if (length == 2 || length == 3) {
PLMN_ = [NSString stringWithFormat:@"%@%@", mcc, mnc];
+
+ Pcre pattern("^[0-9]{5,6}$");
+ if (!pattern(PLMN_))
+ PLMN_ = nil;
+ }
}
if (mnc != NULL)