Fwd: Fwd: Correction to regex in ResourceList.pm (HTTP::DAV)

andreas scherrer ascherrer at gmail.com
Wed Mar 25 21:51:15 UTC 2015


To whom it may concern.


-------- Forwarded Message --------
Subject: Fwd: Correction to regex in ResourceList.pm (HTTP::DAV)
Date: Wed, 18 Apr 2012 22:25:59 +0200
From: andreas scherrer <ascherrer at gmail.com>
To: pcollins at cpan.org

Dear Patrick Collins

As I believe this problem persists I have created a small patch.


Kind regards
andreas scherrer

-------- Original Message --------
Subject: Correction to regex in ResourceList.pm (HTTP::DAV)
Date: Mon, 20 Feb 2012 21:59:20 +0100
From: andreas scherrer <ascherrer at gmail.com>
To: pcollins at cpan.org

Dear Patrick Collins

I am writing to you because you are listed as the author of HTTP::DAV on
CPAN.

I believe the regex in the following lines of ResourceList.pm in the
HTTP:DAV module should *not* have the "g" flag at the end (line 160 in
my (older) version):

$r =~ s/\/*$/\//g; # Add a trailing slash
$u =~ s/\/*$/\//g; # Add a tailing slash

See http://stackoverflow.com/q/9353836/254868 for an explanation why.


Kind regards
andreas scherrer

-- 
People who push both buttons should get their wish.



-------------- next part --------------
--- /usr/local/lib/perl5/site_perl/5.14.2/HTTP/DAV/ORIGINAL_ResourceList.pm	2012-04-18 21:44:59.000000000 +0200
+++ /usr/local/lib/perl5/site_perl/5.14.2/HTTP/DAV/ResourceList.pm	2012-04-18 21:46:14.000000000 +0200
@@ -156,8 +156,8 @@
          # e.g. u=/a  r=/a/b/c.txt
          my $r = $resource_uri->canonical();
          my $u = $url->canonical();
-         $r =~ s/\/*$/\//g; # Add a trailing slash
-         $u =~ s/\/*$/\//g; # Add a tailing slash
+         $r =~ s/\/*$/\//; # Add a trailing slash
+         $u =~ s/\/*$/\//; # Add a tailing slash
          if ($u =~ /\Q$r/ ) {
 
             my @locks = $resource->get_locks(-owned=>$owned);



More information about the freebsd-perl mailing list