pull/1539/head
Victor Baranov 6 years ago
parent 3ab941aff3
commit 097f13e50e
  1. 2
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex
  2. 4
      apps/block_scout_web/test/block_scout_web/views/layout_view_test.exs

@ -80,7 +80,7 @@ defmodule BlockScoutWeb.LayoutView do
release_link = Application.get_env(:block_scout_web, :release_link)
if String.length(release_link) > 0 do
_version_link = Phoenix.HTML.raw("<a href=\"#{release_link}\" target=\"_blank\">#{version}</a>")
_version_link = html_escape({:safe, "<a href=\"#{release_link}\" target=\"_blank\">#{version}</a>"})
else
_version_link = version
end

@ -75,7 +75,9 @@ defmodule BlockScoutWeb.LayoutViewTest do
test "use the version when there is no release_link env configured for it" do
Application.put_env(:block_scout_web, BlockScoutWeb.Chain, version: "1.3.4")
assert LayoutView.release_link() == "1.3.4"
Application.put_env(:block_scout_web, BlockScoutWeb.Chain, release_link: "")
assert LayoutView.release_link("1.3.4") == "1.3.4"
end
end
end

Loading…
Cancel
Save