diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-05-13 12:50:21 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-05-13 12:50:21 +0100 |
commit | 6c8696c6c92860c8fcd2c97ebfbe01f3856c8502 (patch) | |
tree | 50b1d91ba748501fe68f3241637c3fe358d3ccf4 | |
parent | 4545128ada841ffbccbf5cdeb9edb63563fdb07f (diff) |
Check photo allowed on direct display.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Photo.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm index 6a94f92e8..8b00d1533 100644 --- a/perllib/FixMyStreet/App/Controller/Photo.pm +++ b/perllib/FixMyStreet/App/Controller/Photo.pm @@ -73,7 +73,9 @@ sub index :LocalRegex('^(c/)?(\d+)(?:\.(full|tn|fp))?\.jpeg$') { $c->detach( 'no_photo' ) unless @photo; - my $photo = $photo[0]->photo; + my $item = $photo[0]; + $c->detach( 'no_photo' ) unless $c->cobrand->allow_photo_display($item); # Should only be for reports, not updates + my $photo = $item->photo; # If photo field contains a hash if (length($photo) == 40) { |