#92 Double slash in program.php (CVS)

open
nobody
None
5
2004-11-21
2004-11-21
No

This may be elsewhere...

The following line of program.php

if($path[0] != '/')
$path = $webbasedir."/".$coverdir.$path;

Will cause the following message in the coverart admin
area (notice double slash):

Cover Art directory
/var/www/localhost/htdocs/music//cover_art/xxxx/xxxx
not found.

This is because my webbasedir has a trailing "slash".

There is a conflicting line (last line below) elsewhere
in the same file, where the slash is not concatenated
to webbasedir:

bash$ fgrep -R webbasedir *
@:$webbasedir="/var/www/localhost/htdocs/music/";
connect.php:$webbasedir="/var/www/localhost/htdocs/music/";
program.php: global $webbasedir;
program.php: $path = $webbasedir."/".$coverdir.$path;
program.php: global $webbasedir;
program.php: $file = $webbasedir.$coverdir.$file;

Maybe the best thing to do is remove the slash, because
the other line doesn't use it, and then handle the
trailing slash during installation (if the user doesn't
add it, add it for him)...

Discussion