[Prophet] [fwd] Problems with relative paths (from: stephane at shimaore.net)

sunnavy sunnavy at bestpractical.com
Thu Aug 5 06:20:14 EDT 2010


Hi Stephane

I just fixed this in latest sd, turns out that the problem is not in Prophet
but mostly in App::SD::CLI::Command::Publish->work_with_urls().

though I tweaked Prophet::Util->updir too :)

Thanks for reporting this!

best wishes
sunnavy

> Hello,
> 
> Prophet::Server->prophet_static_root() uses a specialized
> Prophet::Util->updir() method to locate the static files it serves,
> instead of using (e.g.) File::ShareDir.
> 
> This creates issues with "sd publish --html": some of the URI paths
> generated by Prophet start with "/../" or "/../../", and it seems the
> SD code(*) does not handles these properly, resulting in HTML files
> being overwritten (with no content).
> 
> (*) It seems the code handling relative paths should be in
> App::SD::CLI::Command::Publish->work_with_urls() and maybe
> handle_redirect().
> 
> 
> I'm not sure whether the best approach is to have Prophet::Server use
> File::ShareDir (which eliminates the source of the issue but might
> still leave relative paths in the templates, for example), modify SD's
> code to normalize ../ and ./ paths, or both.
> 
> Stéphane
> _______________________________________________
> Prophet mailing list
> Prophet at bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/prophet
> 
> ----- End forwarded message -----
> 
> -- 


More information about the Prophet mailing list