Skip Menu |

This queue is for tickets about the CGI-PathInfo CPAN distribution.

Report information
The Basics
Id: 121625
Status: open
Priority: 0/
Queue: CGI-PathInfo

People
Owner: Nobody in particular
Requestors: ALEENA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Relative paths not resolved correctly
I was testing this and found my relative paths were not resolved correctly such as the paths to my style sheets. So, when I use this, the style sheets are not loaded because the relative path is wrong. Let's say I have a script in Directory1/Directory2/script.pl. The relative path to my style sheets is ../../files/css/main.css. When using this, the new path is Directory1/Directory2/script.pl/opt-Selected. The new relative path to my style sheets should be ../../../files/css/main.css. I have the option of dropping relative paths, but that is not preferred. I would have to make all relative links on my site absolute. That has bitten me on more than one occasion. Also, if I could get the Eq option to work and change the - to a /, the relative path would be another level deeper, unless there is a way to not have the parameter name not show up. However, right now, I can't use this because of the problem resolving relative links to files like my style sheets.
Subject: Re: [rt.cpan.org #121625] Relative paths not resolved correctly
Date: Fri, 12 May 2017 12:26:19 -0700 (PDT)
To: Lady Aleena via RT <bug-CGI-PathInfo [...] rt.cpan.org>
From: Jerilyn Franz <snowhare [...] snowhare.com>
This isn't a bug in CGI::PathInfo. The web browser resolves '../' path segments itself and so if using '/' as a path separator the web browser believes the current base directory is deeper. The only workaround to allow relative links to work I can think of while keeping '/' as the tuple separator is to use a consistent # of '/' levels (padding if needed). Alternatively you can use schemeless URLs: //files/css/main.css if site-relative URLs are sufficient to your need. You can also change the parameter tuple SplitOn character to something other than the default '/', that should let you avoid the path interpretation by the browser entirely. On Thu, 11 May 2017, Lady Aleena via RT wrote: Show quoted text
> Thu May 11 18:03:26 2017: Request 121625 was acted upon. > Transaction: Ticket created by ALEENA > Queue: CGI-PathInfo > Subject: Relative paths not resolved correctly > Broken in: (no value) > Severity: Important > Owner: Nobody > Requestors: ALEENA@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=121625 > > > > I was testing this and found my relative paths were not resolved correctly such as the paths to my style sheets. So, when I use this, the style sheets are not loaded because the relative path is wrong. > > Let's say I have a script in Directory1/Directory2/script.pl. The relative path to my style sheets is ../../files/css/main.css. When using this, the new path is Directory1/Directory2/script.pl/opt-Selected. The new relative path to my style sheets should be ../../../files/css/main.css. > > I have the option of dropping relative paths, but that is not preferred. I would have to make all relative links on my site absolute. That has bitten me on more than one occasion. > > Also, if I could get the Eq option to work and change the - to a /, the relative path would be another level deeper, unless there is a way to not have the parameter name not show up. However, right now, I can't use this because of the problem resolving relative links to files like my style sheets. >
Subject: Re: [rt.cpan.org #121625] Relative paths not resolved correctly
Date: Fri, 12 May 2017 12:41:12 -0700 (PDT)
To: Jerilyn Franz via RT <bug-CGI-PathInfo [...] rt.cpan.org>
From: Jerilyn Franz <snowhare [...] snowhare.com>
Also you could use the html base tag to force the browser base url: https://www.w3schools.com/tags/tag_base.asp Jerilyn On Fri, 12 May 2017, Jerilyn Franz via RT wrote: Show quoted text
> Queue: CGI-PathInfo > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=121625 > > > This isn't a bug in CGI::PathInfo. The web browser resolves '../' path > segments itself and so if using '/' as a path separator the web browser > believes the current base directory is deeper. The only workaround to > allow relative links to work I can think of while keeping '/' as the tuple > separator is to use a consistent # of '/' levels (padding if needed). > Alternatively you can use schemeless URLs: //files/css/main.css if > site-relative URLs are sufficient to your need. > > You can also change the parameter tuple SplitOn character to something > other than the default '/', that should let you avoid the path > interpretation by the browser entirely. > > > On Thu, 11 May 2017, Lady Aleena via RT wrote: >
>> Thu May 11 18:03:26 2017: Request 121625 was acted upon. >> Transaction: Ticket created by ALEENA >> Queue: CGI-PathInfo >> Subject: Relative paths not resolved correctly >> Broken in: (no value) >> Severity: Important >> Owner: Nobody >> Requestors: ALEENA@cpan.org >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=121625 > >> >> >> I was testing this and found my relative paths were not resolved correctly such as the paths to my style sheets. So, when I use this, the style sheets are not loaded because the relative path is wrong. >> >> Let's say I have a script in Directory1/Directory2/script.pl. The relative path to my style sheets is ../../files/css/main.css. When using this, the new path is Directory1/Directory2/script.pl/opt-Selected. The new relative path to my style sheets should be ../../../files/css/main.css. >> >> I have the option of dropping relative paths, but that is not preferred. I would have to make all relative links on my site absolute. That has bitten me on more than one occasion. >> >> Also, if I could get the Eq option to work and change the - to a /, the relative path would be another level deeper, unless there is a way to not have the parameter name not show up. However, right now, I can't use this because of the problem resolving relative links to files like my style sheets. >>
>
-- Jeri The only way of discovering the limits of the possible is to venture a little way past them into the impossible. --Arthur C. Clarke
Thanks for the advice. Have a nice day! LA On Fri May 12 15:34:04 2017, snowhare@snowhare.com wrote: Show quoted text
> This isn't a bug in CGI::PathInfo. The web browser resolves '../' path > segments itself and so if using '/' as a path separator the web > browser > believes the current base directory is deeper. The only workaround to > allow relative links to work I can think of while keeping '/' as the > tuple > separator is to use a consistent # of '/' levels (padding if needed). > Alternatively you can use schemeless URLs: //files/css/main.css if > site-relative URLs are sufficient to your need. > > You can also change the parameter tuple SplitOn character to something > other than the default '/', that should let you avoid the path > interpretation by the browser entirely. > > > On Thu, 11 May 2017, Lady Aleena via RT wrote: >
> > Thu May 11 18:03:26 2017: Request 121625 was acted upon. > > Transaction: Ticket created by ALEENA > > Queue: CGI-PathInfo > > Subject: Relative paths not resolved correctly > > Broken in: (no value) > > Severity: Important > > Owner: Nobody > > Requestors: ALEENA@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=121625 > > > > > > > I was testing this and found my relative paths were not resolved > > correctly such as the paths to my style sheets. So, when I use this, > > the style sheets are not loaded because the relative path is wrong. > > > > Let's say I have a script in Directory1/Directory2/script.pl. The > > relative path to my style sheets is ../../files/css/main.css. When > > using this, the new path is Directory1/Directory2/script.pl/opt- > > Selected. The new relative path to my style sheets should be > > ../../../files/css/main.css. > > > > I have the option of dropping relative paths, but that is not > > preferred. I would have to make all relative links on my site > > absolute. That has bitten me on more than one occasion. > > > > Also, if I could get the Eq option to work and change the - to a /, > > the relative path would be another level deeper, unless there is a > > way to not have the parameter name not show up. However, right now, I > > can't use this because of the problem resolving relative links to > > files like my style sheets. > >