[Prophet] Problems with relative paths

Stephane stephane at shimaore.net
Wed Jul 21 08:11:53 EDT 2010


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


More information about the Prophet mailing list