Skip to content

Avoid retaining surrounding contact info in parsed numbers#903

Open
fhwvtqdc2q-svg wants to merge 4 commits into
marmelroy:masterfrom
fhwvtqdc2q-svg:codex/redact-contact-info-from-number-string
Open

Avoid retaining surrounding contact info in parsed numbers#903
fhwvtqdc2q-svg wants to merge 4 commits into
marmelroy:masterfrom
fhwvtqdc2q-svg:codex/redact-contact-info-from-number-string

Conversation

@fhwvtqdc2q-svg
Copy link
Copy Markdown

Summary

  • store only the phone number matched by NSDataDetector in PhoneNumber.numberString
  • prevent surrounding contact text such as names or email addresses from being retained after parsing
  • add a regression test covering contact text around a valid phone number

Why

When parsing input that contains a phone number embedded in contact text, parsing already uses the detector match for validation, but the returned PhoneNumber could keep the original input string. If callers log, encode, or turn numberString into a tel URL, surrounding contact data may be exposed unnecessarily.

Testing

Not run locally because this environment is Windows and does not have Swift/Xcode installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants