aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-05-13 12:44:34 +0100
committerMatthew Somerville <matthew@mysociety.org>2013-05-13 12:44:34 +0100
commit4545128ada841ffbccbf5cdeb9edb63563fdb07f (patch)
tree264df205cf80b4d86506731d1a172e3feea552b0
parentd85a86711c2b3e7b670da2043b8e8cbc99fece0a (diff)
Tweak function as RSS call returns string, not hash.
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 7f7125b29..0d9fd5752 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -3,6 +3,7 @@ use base 'FixMyStreet::Cobrand::Default';
use DateTime;
use POSIX qw(strcoll);
+use RABX;
use strict;
use warnings;
@@ -105,7 +106,13 @@ sub updates_as_hashref {
sub allow_photo_display {
my ( $self, $r ) = @_;
- my $extra = ref($r) eq 'HASH' ? $r->{extra} : $r->extra;
+ if (ref($r) ne 'HASH') {
+ return $r->extra->{publish_photo};
+ }
+ my $extra = $r->{extra};
+ utf8::encode($extra) if utf8::is_utf8($extra);
+ my $h = new IO::String($extra);
+ $extra = RABX::wire_rd($h);
return $extra->{publish_photo};
}