Bug 3589 - Parsing for File:// URLs under windows fails when drive letter included.
: Parsing for File:// URLs under windows fails when drive letter included.
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 6.3.0
: PC Windows XP
: P3 minor (vote)
: ---
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-16 15:21 UTC by Bryan Alton
Modified: 2008-09-15 14:38 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Alton 2006-06-16 15:21:02 UTC
I am trying to use the XMLbrowser to access a file whose path is created from the file name and the playlistdir pref.  In windows the pref uses the "\" notation in the file path which results in a bad parse.

I can reproduce the problem using Podcast Browswer.  When I tried to access from the web a podcast whose address is 
"file://C:\Program Files\SlimServer\server\Playlists\mypicks.opml"
The following message was displayed on the LHS of the web page screen
"There was an error loading the remote feed for : (Unable to open file 'C:')"

With debugging d_files the following messages are logged from Slim::Utils::Misc::pathFromFileURL

2006-06-16 22:53:29.5388 Got  from file url file://C:\Program Files\SlimServer\server\Playlists\mypicks.opml
2006-06-16 22:53:29.5391 extracted: C: from file://C:\Program Files\SlimServer\server\Playlists\mypicks.opml

If the URL is changed to "file://C:/Program Files/SlimServer/server/Playlists/mypicks.opml" it works correctly.

The problem is the file URL is created from the playlistdir pref which seems to use the "\" notation.
Comment 1 Blackketter Dean 2006-06-18 08:47:18 UTC
Andy: it looks like the URL isn't converted properly from backslashes to slashes
Comment 2 Andy Grundman 2006-06-18 09:11:21 UTC
Indeed, it didn't occur to me to support illegal chars in URLs. ;)  I'll put in a fix.
Comment 4 Bryan Alton 2006-06-20 15:54:40 UTC
(In reply to comment #3)
> Does this fix the problem?
> 
> http://svn.slimdevices.com/branches/BRANCH_6_3_x/server/Slim/Utils/Misc.pm?rev=8065&r1=7347&r2=8065
> 

It should do - it is the same code I used to workaround the problem.

Comment 5 Chris Owens 2006-06-27 14:22:05 UTC
This bug fix is now part of a released version, and so has been marked closed. If you are still experiencing this problem, please reopen the bug.