SETUP:
I have three images: (a) images/foo.png, (b) images/foo,bar.png, and (c) images/foo bar.png [contains a space].

1. In the 'Fast Gallery' settings, the permission for all users is checked.
2. The path to the gallery is: images/
3. Under operations, all actions are taken, ClearDB, rescan, and flush (though Imagecache is not installed).

PROBLEM:
When viewing the gallery page, it is only the thumbnail for image (a) that exist.

TROUBLESHOOTING:
Looking at the HTML of the gallery page, it contains, for the image (a):

<div class="single-image">
 <a href="/images/public/foo/foo.png" class="" title="">
  <img src="/images/public/foo/foo.png.thumb" alt="Thumb of images/public/foo/foo.png" title="" width="100" height="100" />
 </a>
 <div class="image-caption"></div>
</div>

but for image (b) only:

<div class="single-image">
 <a href="/images/public/foo/foo%2Cbar.png" class="" title=""></a>
 <div class="image-caption"></div></div><div class="pager"></div>
</div>

and for image (c) likewise:

<div class="single-image">
 <a href="/images/public/foo/foo%20bar.png" class="" title=""></a>
 <div class="image-caption"></div>
</div>

Note how the img-tag for the thumbnails for (b) and (c) are missing. However, all thumbnail files are indeed created on the webserver;

(a) images/foo.png.thumb
(b) images/foo,png.thumb
(c) images/foo png.thumb

CONCLUSION:
As a first-time user and Drupal rookie, I can only conclude that the HTML-generating code is not working properly.

BTW, note that according to RFC1738 [http://tools.ietf.org/html/rfc1738], commas can be left unencoded in URLs:

Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used
unencoded within a URL.

Is this a bug? Suggestions for workarounds are welcome (I do need to have commas in my file names and commas are legal in a file systems I know of).

Thanks

Henrik

Comments

hbengtsson’s picture

Status: Active » Patch (to be ported)

I noticed the workaround for the '%' character that exist in fast_gallery.module starting at line 606. Adding a similar fix for each of the RFC1738 special characters "$-_.+!*'(),", except "*" solved my problem. I've validated that the fix is required for all those character too.

PATCH:

      // Form the <img> tag. Special characters don't work right with the
      // theme() function, so we have to do this part manually.
      if (variable_get('clean_url', 0) == 1) {
        $path_adj = str_replace('%20', ' ', $path_adj);
        $path_adj = str_replace('%21', '!', $path_adj);
        $path_adj = str_replace('%24', '$', $path_adj);
        $path_adj = str_replace('%25', '%', $path_adj);
        $path_adj = str_replace('%27', '\'', $path_adj);
        $path_adj = str_replace('%28', '(', $path_adj);
        $path_adj = str_replace('%29', ')', $path_adj);
        $path_adj = str_replace('%2B', '+', $path_adj);
        $path_adj = str_replace('%2C', ',', $path_adj);
      }

/Henrik

rapsli’s picture

hi. can you provide a valid patch file?

rapsli’s picture

Status: Patch (to be ported) » Closed (won't fix)

this version is not supported anymore