Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #4075: Sanitize Device Name while displaying in Sync Settings Screen #4076

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

soner-yuksel
Copy link
Contributor

@soner-yuksel soner-yuksel commented Aug 19, 2021

Fixes low priority security issue for History Sync PR.
#3703 (comment)

Summary of Changes

This pull request fixes #4075

Submitter Checklist:

  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()

Reviewer Checklist:

  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate unit test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable).
  • Issue and pull request is assigned to a milestone (should happen at merge time).

@soner-yuksel soner-yuksel added this to the 1.31 milestone Aug 19, 2021
@soner-yuksel soner-yuksel requested review from jumde and a team August 19, 2021 16:41
@soner-yuksel soner-yuksel self-assigned this Aug 19, 2021

/// Encode Strings which are not sanitized for displaying
/// - Returns: Encoded String
public func encodeContaminatedString() -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a simple function, but maybe add a small unit test for it?
this can also be a computer property instead of a func

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use this code or remove it, looks like we are duplicating code here: https://github.com/brave/brave-ios/blob/development/Shared/Extensions/WKWebViewExtensions.swift#L83?

Copy link
Contributor Author

@soner-yuksel soner-yuksel Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap I am carrying that exact function inside StringExtensions and adding test for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate method is removed and added as computed property and unit tests are added

Changes at 26c16ac

Copy link
Contributor

@jumde jumde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@soner-yuksel soner-yuksel merged commit 12a9925 into development Aug 23, 2021
@soner-yuksel soner-yuksel deleted the fix/sanitize-name-sync-settings branch August 23, 2021 14:28
Copy link

@jayy7312 jayy7312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sanitize Device Name while displaying in Sync Settings Screen
4 participants