File tree Expand file tree Collapse file tree 3 files changed +25
-12
lines changed Expand file tree Collapse file tree 3 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 44
55namespace Icinga \Module \Notifications \Controllers ;
66
7+ use Exception ;
78use Icinga \Module \Notifications \Common \Database ;
89use Icinga \Util \Environment ;
910use Icinga \Util \Json ;
@@ -41,8 +42,8 @@ public function indexAction(): void
4142 $ this ->httpBadRequest ('The given identifier is not a valid UUID ' );
4243 }
4344
44- $ filter = FilterProcessor:: assembleFilter (
45- QueryString::fromString (rawurldecode (Url::fromRequest ()->getQueryString ()))
45+ try {
46+ $ filterRule = QueryString::fromString (rawurldecode (Url::fromRequest ()->getQueryString ()))
4647 ->on (
4748 QueryString::ON_CONDITION ,
4849 function (Filter \Condition $ condition ) {
@@ -62,8 +63,12 @@ function (Filter\Condition $condition) {
6263 $ condition ->setColumn ('external_uuid ' );
6364 }
6465 }
65- )->parse ()
66- );
66+ )->parse ();
67+
68+ $ filter = FilterProcessor::assembleFilter ($ filterRule );
69+ } catch (Exception $ e ) {
70+ $ this ->httpBadRequest ($ e ->getMessage ());
71+ }
6772
6873 $ stmt = (new Select ())
6974 ->distinct ()
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ public function indexAction(): void
6666 $ this ->httpBadRequest ('Filter is only allowed for GET requests ' );
6767 }
6868
69- $ filter = FilterProcessor:: assembleFilter (
70- QueryString::fromString ($ filterStr )
69+ try {
70+ $ filterRule = QueryString::fromString ($ filterStr )
7171 ->on (
7272 QueryString::ON_CONDITION ,
7373 function (Filter \Condition $ condition ) {
@@ -87,8 +87,12 @@ function (Filter\Condition $condition) {
8787 $ condition ->setColumn ('external_uuid ' );
8888 }
8989 }
90- )->parse ()
91- );
90+ )->parse ();
91+
92+ $ filter = FilterProcessor::assembleFilter ($ filterRule );
93+ } catch (Exception $ e ) {
94+ $ this ->httpBadRequest ($ e ->getMessage ());
95+ }
9296
9397 switch ($ method ) {
9498 case 'GET ' :
Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ public function indexAction(): void
7171 $ this ->httpBadRequest ('Filter is only allowed for GET requests ' );
7272 }
7373
74- $ filter = FilterProcessor:: assembleFilter (
75- QueryString::fromString ($ filterStr )
74+ try {
75+ $ filterRule = QueryString::fromString ($ filterStr )
7676 ->on (
7777 QueryString::ON_CONDITION ,
7878 function (Filter \Condition $ condition ) {
@@ -92,8 +92,12 @@ function (Filter\Condition $condition) {
9292 $ condition ->setColumn ('external_uuid ' );
9393 }
9494 }
95- )->parse ()
96- );
95+ )->parse ();
96+
97+ $ filter = FilterProcessor::assembleFilter ($ filterRule );
98+ } catch (Exception $ e ) {
99+ $ this ->httpBadRequest ($ e ->getMessage ());
100+ }
97101
98102 switch ($ method ) {
99103 case 'GET ' :
You can’t perform that action at this time.
0 commit comments