Merge pull request #5568 from blockscout/np-add-regexpf-for-ipfs

Add regexp for ipfs checking
pull/5592/head
Victor Baranov 3 years ago committed by GitHub
commit db2df0c298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 4
      apps/block_scout_web/lib/block_scout_web/views/tokens/instance/overview_view.ex

@ -5,6 +5,7 @@
- [#5540](https://github.com/blockscout/blockscout/pull/5540) - Tx page: scroll to selected tab's data
### Fixes
- [#5568](https://github.com/blockscout/blockscout/pull/5568) - Add regexp for ipfs checking
- [#5567](https://github.com/blockscout/blockscout/pull/5567) - Sanitize token name and symbol before insert into DB, display in the application
- [#5564](https://github.com/blockscout/blockscout/pull/5564) - Add fallback clauses to `string_to_..._hash` functions
- [#5538](https://github.com/blockscout/blockscout/pull/5538) - Fix internal transaction's tile bug

@ -179,11 +179,11 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewView do
defp compose_ipfs_url(image_url) do
cond do
image_url =~ "ipfs://ipfs" ->
image_url =~ ~r/^ipfs:\/\/ipfs/ ->
"ipfs://ipfs" <> ipfs_uid = image_url
"https://ipfs.io/ipfs/" <> ipfs_uid
image_url =~ "ipfs://" ->
image_url =~ ~r/^ipfs:\/\// ->
"ipfs://" <> ipfs_uid = image_url
"https://ipfs.io/ipfs/" <> ipfs_uid

Loading…
Cancel
Save