Skip to content

Better handling of bookmarks #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2017
Merged

Conversation

ananace
Copy link
Contributor

@ananace ananace commented Aug 24, 2017

We ran into #542 at work today, so I sat down to figure out why the issue exists and how to solve it.
Here's a mostly client-side solution for the issue. (Instead of handling quotes and escaping them correctly on the python side I just pass them as " entities down from the web ui)

The problem stems from the HTML concatenation in refresh_bookmarks, where any bookmarks containing quotes will end up breaking the generated HTML, before bubbling upwards to affect saving and browsing to the saved bookmarks as well.

The same issue also happens in modal_managebookmarks.tpl where HTML is generated containing quotes instead of " entities.
I'll see about maybe adding in some validation on the server side as well tomorrow, replacing HTML entities when loading and saving to the database.

An additional fix that's included here changes the generated links in the bookmarks modal to actually link to the search page instead of just being a link of the bookmark search text.

@maethor
Copy link
Contributor

maethor commented Aug 25, 2017

This is really nice, thank you @Ace13 !

I merge it now, but I don't have time to release the next version right now, maybe monday.

@maethor maethor merged commit 4e7e622 into shinken-monitoring:develop Aug 25, 2017
@maethor
Copy link
Contributor

maethor commented Sep 3, 2017

@Ace13 I just published Shinken WebUI 2.5.4 with your PR. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants