Skip to content
#

mozilla

Here are 472 public repositories matching this topic...

mariansima
mariansima commented Dec 2, 2021

Steps to reproduce

  1. Find an image with a long name e.g. https://en.wikipedia.org/wiki/Main_Page#/media/File:HMS_Seringapatam_at_anchor_in_Valetta_Harbour_-_Anton_Schranz.jpg
  2. Save the image
  3. Observe the notification after download is finished

Expected behaviour

The name is fully visible

Actual behaviour

The name is truncated
![262621408_944622912817064_909462865476

st3fan
st3fan commented Jan 7, 2022

In URLExtensions.swift we have isIPv4 and isIPv6 functions. The first uses a regex and the second just checks for the presence of a : in the string. Let's replace this with a call to inet_pton() to let the OS parse the address instead - delegating to a trusted OS function will be more robust.

Example at https://stackoverflow.com/questions/35056268/how-to-use-swift-convert-string-to-ip

Improve this page

Add a description, image, and links to the mozilla topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the mozilla topic, visit your repo's landing page and select "manage topics."

Learn more