OSDN Git Service

Web::Contorller::API::Story: fix related story url regex
authorhylom <hylom@users.osdn.me>
Mon, 10 Jun 2019 07:17:22 +0000 (07:17 +0000)
committerhylom <hylom@users.osdn.me>
Mon, 10 Jun 2019 07:17:22 +0000 (07:17 +0000)
src/newslash_web/lib/Newslash/Web/Controller/API/Story.pm

index 18ddf67..87a63c1 100644 (file)
@@ -158,7 +158,7 @@ sub post {
     my @relateds = split(/\s+/, $related_string);
     my $related_sids = [];
     for my $related (@relateds) {
-        if ($related =~ m|^.*(\d\d/\d\d/\d\d/\d+)/|) {
+        if ($related =~ m|^.*(\d\d/\d\d/\d\d/\d+)/?|) {
             push @$related_sids, $1;
         }
     }