aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-09-03 16:33:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-09-03 16:36:43 +0100
commit4b7da24b5d2605d25c45bbeef1328f8118334b31 (patch)
tree9fd174166779b88627d9cd833aaa0fcaec6df5bd
parent49c74ded4275005e766a948ec47d4cc722e0567e (diff)
Allow more characters in name splitting.
Not sure how this has not arisen before!
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm2
-rw-r--r--perllib/Open311.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index ce7c0971f..391106346 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -194,7 +194,7 @@ sub open311_config {
# make sure we have last_name attribute present in row's extra, so
# it is passed correctly to Bromley as attribute[]
if ( $row->cobrand ne 'bromley' ) {
- my ( $firstname, $lastname ) = ( $row->name =~ /(\w+)\.?\s+(.+)/ );
+ my ( $firstname, $lastname ) = ( $row->name =~ /(\S+)\.?\s+(.+)/ );
push @$extra, { name => 'last_name', value => $lastname };
}
diff --git a/perllib/Open311.pm b/perllib/Open311.pm
index 07f659c0b..d1659bea1 100644
--- a/perllib/Open311.pm
+++ b/perllib/Open311.pm
@@ -461,7 +461,7 @@ sub split_name {
return ('', '') unless $name;
- my ( $first, $last ) = ( $name =~ /(\w+)(?:\.?\s+(.+))?/ );
+ my ( $first, $last ) = ( $name =~ /(\S+)(?:\.?\s+(.+))?/ );
return ( $first || '', $last || '');
}