1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00
phorge-phorge/src
epriestley 70056a9072 When creating a file by downloading a URI, truncate the length of the default name
Summary:
See <https://discourse.phabricator-community.org/t/embedding-external-images-url-show-error-for-long-urls/1339>.

When we download a file from a URI, we provide a default name based on the URI. However, if the URI is something like `http://example.com/very-very-very-....-long.jpg` with more than 255 characters, we may suggest a name which won't fit into the `name` column of `PhabricatorFile`.

Instead, suggest a default name no longer than 64 bytes.

Test Plan:
  - Used the `{image ...}` example from the Discourse report locally; got an image with a truncated name.
  - Used a normal `{image ...}`, got an image file with a normal name.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19353
2018-04-12 13:29:53 -07:00
..
__tests__ Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-14 07:49:01 +10:00
aphront Fix DocumentEngine line behaviors in Diffusion 2018-04-09 04:46:47 -07:00
applications When creating a file by downloading a URI, truncate the length of the default name 2018-04-12 13:29:53 -07:00
docs Remove "Large Changes" documentation and make some minor behavioral improvements 2018-04-05 06:40:46 -07:00
extensions
infrastructure Fix YouTube remarkup rule being blocked by Content-Security-Policy header 2018-04-02 16:11:02 -07:00
view When following a link to a particular line ("/example.txt$12"), scroll to that line 2018-04-11 17:29:22 -07:00
__phutil_library_init__.php
__phutil_library_map__.php Allow Almanac properties to be set and deleted via Conduit 2018-04-11 10:42:10 -07:00