Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ApacheGallery] Fw: modules/gallery/lib/Apache (Gallery.pm): Provide our own, perhaps not broken, version of uri_escape



Hi guys!

I've been following your development of Apache::Gallery for some weeks
now.
Unfortunately, I'm not very much of a programmer, but I would like to
give a later version than 0.3.1 a try.

Instead of trying to backtrack everything you have been up to in the
last weeks, is it possible to download the latest development from
somewhere?

Thanks,

Frode

-----Original Message-----
From: Paul Vallee [mailto:vallee@xxxxxxxxxxx] 
Sent: 11. mars 2002 16:19
To: Paul Vallee; Michael Legart; users@xxxxxxxxxxxxxxxx
Subject: Re: [ApacheGallery] Fw: modules/gallery/lib/Apache
(Gallery.pm): Provide our own, perhaps not broken, version of uri_escape


I've noticed a problem with the new uri_escape.

https://gallery.vandewolfshaar.com/2002_02_14%20Nicole%20TC%20goodbye%20
part
y

There are two special characters there on one file... in the word
Hélène. The image doesn't come up.

Any ideas?

Best,
Paul
----- Original Message -----
From: "Paul Vallee" <vallee@xxxxxxxxxxx>
To: "Michael Legart" <michael@xxxxxxxxx>; <users@xxxxxxxxxxxxxxxx>
Sent: Sunday, March 10, 2002 11:24 AM
Subject: Re: [ApacheGallery] Fw: modules/gallery/lib/Apache
(Gallery.pm): Provide our own, perhaps not broken, version of uri_escape


Hi Michael,
Yup, it seems to work just fine. Thanks!
Will now retrofit my work to it.
Paul
----- Original Message -----
From: "Michael Legart" <michael@xxxxxxxxx>
To: <users@xxxxxxxxxxxxxxxx>
Sent: Saturday, March 09, 2002 6:57 AM
Subject: [ApacheGallery] Fw: modules/gallery/lib/Apache (Gallery.pm):
Provide our own, perhaps not broken, version of uri_escape


> Hi,
>
> Paul - can you test to see if this works on perl 5.6.0?
>
> ----- Forwarded message from CVS-mil <copenhagen@xxxxxxxx> -----
>
> From: CVS-mil <copenhagen@xxxxxxxx>
> Subject: modules/gallery/lib/Apache (Gallery.pm): Provide our own, 
> perhaps
not broken, version of uri_escape
> To: cvs@xxxxxxxxx
> Date: 9 Mar 2002 11:55:59 -0000
>
> -----------------
> --     Log     --
> -----------------
>
> Modified Files:
> Gallery.pm
> Log Message:
> Provide our own, perhaps not broken, version of uri_escape
>
>
> -----------------
> --   Changes   --
> -----------------
>
> Index: modules/gallery/lib/Apache/Gallery.pm
> diff -u modules/gallery/lib/Apache/Gallery.pm:1.72
modules/gallery/lib/Apache/Gallery.pm:1.73
> --- modules/gallery/lib/Apache/Gallery.pm:1.72 Thu Feb 28 16:56:02 
> 2002
> +++ modules/gallery/lib/Apache/Gallery.pm Sat Mar  9 12:55:57 2002
> @@ -1,6 +1,6 @@
>  package Apache::Gallery;
>
> -# $Id: Gallery.pm,v 1.72 2002/02/28 15:56:02 mil Exp $
> +# $Id: Gallery.pm,v 1.73 2002/03/09 11:55:57 mil Exp $
>
>  use 5.006;
>  use strict;
> @@ -17,11 +17,11 @@
>  use Image::Info qw(image_info);
>  use Image::Size qw(imgsize);
>  use CGI::FastTemplate;
> -use URI::Escape;
>  use File::stat;
>  use POSIX qw(floor);
> +use Carp;
>
> -my $escape_rule = '^a-zA-Z0-9\/_\\.';
> +my $escape_rule = "^A-Za-z0-9\-_.!~*'()\/";
>
>  use Inline C => Config =>
>   LIBS => '-L/usr/X11R6/lib -lImlib2 -lttf -lm -ldl -lXext -lXext', @@

> -599,6 +599,31 @@
>   }
>
>   return $menu;
> +}
> +
> +
> +# Because of some problems with bugs in URI::Escape in perl 5.6.0 # 
> +we include our own version here for now. my %escapes;
> +# Build a char->hex map
> +for (0..255) {
> + $escapes{chr($_)} = sprintf("%%%02X", $_);
> +}
> +my %subst; # compiled patterns (cached)
> +sub uri_escape {
> +
> + my ($text, $pattern) = @_;
> + return undef unless defined $text;
> +
> + unless (exists $subst{$pattern}) {
> + (my $tmp = $pattern) =~ s,/,[^\]\\/,g;
> + $subst{$pattern} =
> + eval "sub {\$_[0] =~ s/([$tmp])/\$escapes{\$1}/g; }";
> + Carp::croak("uri_escape: $@") if $@;
> + }
> + &{$subst{$pattern}}($text);
> +
> + return $text;
>  }
>
>  1;
>
> ----- End forwarded message -----
>
> ---------------------------------------------------------------------
> Apache::Gallery users mailinglist. http://apachegallery.dk/ To 
> unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>
>
>


---------------------------------------------------------------------
Apache::Gallery users mailinglist. http://apachegallery.dk/
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx





---------------------------------------------------------------------
Apache::Gallery users mailinglist. http://apachegallery.dk/
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
Apache::Gallery users mailinglist. http://apachegallery.dk/
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx