Skip to content
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

Search in filtered Activity Log make Oops #1381

Closed
xeiss opened this issue Feb 5, 2018 · 1 comment
Closed

Search in filtered Activity Log make Oops #1381

xeiss opened this issue Feb 5, 2018 · 1 comment
Labels
Milestone

Comments

@xeiss
Copy link

xeiss commented Feb 5, 2018

Expected Behavior

Filter a the Activity Log in GUI (example - Sync Rule \ Last sync run deatails - click on "1 created")
Type in a search word and get the searched entry in filtered view

Current Behavior

A search in filtered activity log will cause a oops:

SQLSTATE[22007]: Invalid datetime format: 1367 Illegal double '3E5454' value found during parsing, query was: SELECT COUNT(*) AS cnt FROM director_activity_log AS l WHERE (id%3E5454 = 'undefined' AND id%3C = '5455' AND l.action_name = 'create') AND (l.author LIKE '%test%' OR l.object_name LIKE '%test%' OR l.object_type LIKE '%test%' OR action_name LIKE '%test%') (Pdo.php:225)

URL before search: /icinga/director/config/activities?id>5454&id<=5455&action=create
URL after search: /icinga/director/config/activities?id%253E5454=undefined&id%253C=5455&action=create&q=test

With this URL the search is okay: /icinga/director/config/activities?id>5454&id<=5455&action=create

Possible Solution

Prohibit the convert of > and < to %253E and %253C

Your Environment

Director version: master (last update: 05.02.2018)
Icinga Web 2 version and modules: 2.5.1-1.stretch
Icinga 2 version: 2.8.1-1.stretch
Operating System and version: Debian 9 (stretch)
Webserver, DB, PHP versions: Apache 2.4.25-3+deb9u3, mariadb-10.1.26-0+deb9u1, PHP-7.0.27-0+deb9u1

@Thomas-Gelf
Copy link
Contributor

@Naro370: can be reproduced, thanks for reporting this. Seems that the bug is to be fixed in Icinga Web 2, as re-encoding the URL on form submission fails to correctly handle encoded params, so this results in double-encoded values on form submission. I'll try to figure out whether we can easily fix this in the base framework. Alternatively we could work around this issue by filtering via Sync Run Id instead of Activity Log "Range".

@Thomas-Gelf Thomas-Gelf added the bug label Feb 5, 2018
@Thomas-Gelf Thomas-Gelf added this to the 1.6.0 milestone Sep 5, 2018
@Thomas-Gelf Thomas-Gelf modified the milestones: 1.6.0, 1.7.0 Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants