SHRIKEE, I got your email but I figure working on this here will be easier than trying to co-ordinate a bunch of different emails...
Garvin, sometime in the next few days I will sit down and try to trace this issue... (Or at least write a full bug report of what I am seeing.)
If you know of something that might cause it off the top of your head, I'd love any suggestions...
Essentially, in my two installs (One 0.9.1 and the other 1.0-beta1, running under apache 1.3.33 on windows, php 4.3.11) I am finding serendipity_traversePath will return paths with multiple backslashes for some subfolders below two levels. I don't know which subfolders or why they are a problem yet.
I believe the difference between SHRIKEE's problem and mine probably arise from different methods of adding the files. I used the "Rebuild Thumbs" link in the administrator, and I would bet money SHRIKEE used the standard form to add the images, which happens to use serendipity_traversePath output for the dropdown box. So I believe the problem is just in the relpath output from serendipity_traversePath.
Testing the addition of a picture to the database using the Add media page I receive this output:
Code: Select all
File what-I-would-use.jpg successfully uploaded as C:/serendipitypath/uploads/Alphie//Alphie1//test1/test2/what-I-would-use.jpg
Thumbnail created.
Done.
Note the double slashes between Alphie and Alphie1 and test1... That data is added to the database.
The check I used to test for this in input (in the usergallery plugin) is:
Code: Select all
$getpathtemp = str_replace("//","/",str_replace("..","",$_GET['gallery']));
(obviously this is also testing for dots in the path..)
I think perhaps a patch like (untested patch follows):
Code: Select all
Index: functions_images.inc.php
===================================================================
--- functions_images.inc.php (revision 993)
+++ functions_images.inc.php (working copy)
@@ -1619,7 +1619,7 @@
$files[] = array(
'name' => $file,
'depth' => $depth,
- 'relpath' => ltrim(str_replace('\\', '/', serendipity_dirSlash('end', $dir)) . basename($file) . ($bIsDir ? '/' : ''), '/'),
+ 'relpath' => str_replace("//","/",ltrim(str_replace('\\', '/', serendipity_dirSlash('end', $dir)) . basename($file) . ($bIsDir ? '/' : ''), '/')),
'directory' => $bIsDir
);
}
would work, but certainly does not address the underlying cause. It also might break installs for anyone who is operating with this type of structure.