diff options
author | Dave Whiteland <dave@mysociety.org> | 2012-12-17 17:54:46 +0000 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2012-12-17 17:54:46 +0000 |
commit | 6023b6851c17baa50f44a8be851d647c2cba4a55 (patch) | |
tree | 6413bcb4630dea85eb20a14e6a319b3fb2c2ccad /bin | |
parent | 1d45c3c88c77227bef7859ef47de45a79d1ad266 (diff) |
don't add newlines when adding media_url after stripper control chars
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/oxfordshire/open311_service_request.cgi | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/oxfordshire/open311_service_request.cgi b/bin/oxfordshire/open311_service_request.cgi index cc9e03171..109981fda 100755 --- a/bin/oxfordshire/open311_service_request.cgi +++ b/bin/oxfordshire/open311_service_request.cgi @@ -160,7 +160,7 @@ sub post_service_request { foreach (values %F) { $data{$_} = $req -> param($_); $data{$_} =~ s/^\s+|\s+$//g; # trim - + if ($STRIP_CONTROL_CHARS) { if ($STRIP_CONTROL_CHARS eq 'ruthless') { $data{$_} =~ s/[[:cntrl:]]/ /g; # strip all control chars, simples @@ -175,7 +175,7 @@ sub post_service_request { } } } - + error_and_exit(CODE_OR_ID_NOT_PROVIDED, "missing service code (Open311 requires one)") unless $data{$F{SERVICE_CODE}}; error_and_exit(GENERAL_SERVICE_ERROR, "the service code you provided ($data{$F{SERVICE_CODE}}) was not recognised by this server") @@ -295,7 +295,7 @@ sub insert_into_pem { my $description = $$h{$F{DESCRIPTION}}; my $media_url = $$h{$F{MEDIA_URL}}; if ($media_url) { - $description .= "\n\nPhoto: $media_url\n"; + $description .= ($STRIP_CONTROL_CHARS ne 'ruthless'? "\n\n":" ") . "Photo: $media_url"; } my $sth = $dbh->prepare(q# |