Skip to content

Commit

Permalink
Check the validity of the generatorURL field
Browse files Browse the repository at this point in the history
The Source button should only be displayed if the link starts by
'http://' or 'https://'.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
  • Loading branch information
simonpasquier authored and gotjosh committed Aug 23, 2023
1 parent 6fe1a24 commit b8f6039
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.26.0-rc.0 / 2023-08-17
## 0.26.0 / 2022-08-23

* [CHANGE] Telegram Integration: `api_url` is now optional. #2981
* [CHANGE] Telegram Integration: `ParseMode` default is now `HTML` instead of `MarkdownV2`. #2981
Expand All @@ -25,6 +25,7 @@
* [BUGFIX] API: Fixed duplicate receiver names in the `api/v2/receivers` API endpoint. #3338
* [BUGFIX] API: Attempting to delete a silence now returns the correct status code, `404` instead of `500`. #3352
* [BUGFIX] Clustering: Fixes a panic when `tls_client_config` is empty. #3443
* [BUGFIX] Fix stored XSS via the /api/v1/alerts endpoint in the Alertmanager UI.

## 0.25.0 / 2022-12-22

Expand Down
4 changes: 2 additions & 2 deletions asset/assets_vfsdata.go

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions ui/app/src/Views/Shared/Alert.elm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ titleView alert =

generatorUrlButton : String -> Html msg
generatorUrlButton url =
a
[ class "btn btn-outline-info border-0", href url ]
[ i [ class "fa fa-line-chart mr-2" ] []
, text "Source"
]
if String.startsWith "http://" url || String.startsWith "https://" url then
a
[ class "btn btn-outline-info border-0", href url ]
[ i [ class "fa fa-line-chart mr-2" ] []
, text "Source"
]

else
text ""

0 comments on commit b8f6039

Please sign in to comment.