diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-12-09 14:40:18 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-12-09 19:14:00 +0000 |
commit | 95b1ca5771d40921ea88ae007dd59d5a70f2802c (patch) | |
tree | 5eb68fdbe732260b2d6a25196fce2687d3d41db9 /perllib/FixMyStreet/App/Controller/Rss.pm | |
parent | bd3fbd345cebb859a5d97ce6d5a11b61c08ad3da (diff) |
[UK] Add SQL problem restrictions for RSS feeds.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index cb59689b4..c418c92b3 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -223,8 +223,11 @@ sub query_main : Private { # FIXME Do this in a nicer way at some point in the future... my $query = 'select * from ' . $alert_type->item_table . ' where ' . ($alert_type->head_table ? $alert_type->head_table . '_id=? and ' : '') - . $alert_type->item_where . ' order by ' - . $alert_type->item_order; + . $alert_type->item_where . ' '; + if ($c->cobrand->can('problems_sql_restriction')) { + $query .= $c->cobrand->problems_sql_restriction($alert_type->item_table); + } + $query .= ' order by ' . $alert_type->item_order; my $rss_limit = FixMyStreet->config('RSS_LIMIT'); $query .= " limit $rss_limit" unless $c->stash->{type} =~ /^all/; |