diff --git a/application/controllers/api/frontend/v1/Report.php b/application/controllers/api/frontend/v1/Report.php index 7474f6418..e9e40c5bb 100644 --- a/application/controllers/api/frontend/v1/Report.php +++ b/application/controllers/api/frontend/v1/Report.php @@ -147,8 +147,12 @@ class Report extends FHCAPI_Controller $label .= ((array)$option)[array_find(array_keys((array)$option), function ($key) { return $key != 'value'; })]; + + // Remove hacks in sql query like preselecting an entry (eg: '" selected="selected') + $value = preg_replace('#([^\\\])".*#', '$1', $option->value); + return [ - 'value' => $option->value, + 'value' => $value, 'label' => $label, ]; }, $options);