Bill Moseley wrote:
> BTW -- not really a problem but I'm wondering if I'm using the Image
> plugin correctly:
> 
>     USE Image( 
>         root = '/var/www/doc_root,
>         name = /images/test.png'
>     );
> 
> works well for "Image.tag", but ends up using catfile so the final
> (real file) path has two slashes.

Try the attached patch, which adds a call to canonpath.

(darren)
Index: lib/Template/Plugin/Image.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Plugin/Image.pm,v
retrieving revision 1.14
diff -u -r1.14 Image.pm
--- lib/Template/Plugin/Image.pm        2004/01/30 19:33:17     1.14
+++ lib/Template/Plugin/Image.pm        2005/09/27 13:10:50
@@ -82,7 +82,7 @@
     # to a root directory

     if ($root = $config->{ root }) {
-        $file = File::Spec->catfile($root, $name);
+        $file = File::Spec->canonpath(File::Spec->catfile($root, $name));
     }
     else {
         $file = $name;

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to