samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Thickbox doesn't display images when %GALLERY_NAME% contains whitespace #395

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. View a gallery that contains a whitespace in its name

1a. this will most likely happen when get_the_title() is called in 
get_thumbcode()

2. with thickbox enabled, try to view an image in the gallery

3. the "loading" animation is shown and never completes the image load

What is the expected output? What do you see instead?

I expect to see the image displayed in Thickbox, but that doesn't happen. Only 
see the loading animation. Other galleries on the same page w/ a proper 
$galleryID appear to load fine.

The core issue is that the rel='%GALLERY_NAME%' replacement happens and 
substitutes a value with whitespace into the rel param.

What version of the product are you using? On what operating system?

NGG: 1.8.2
WP: 3.2.1

Please provide any additional information below.

This can be fixed by adding a very simple preg_replace at the very top of the 
get_thumbcode function in lib/image.php to scrub whitespace:

=====
    // Fix thickbox failure when $galleryname has a space in it
    $galleryname = preg_replace( '/\s+/', '', $galleryname );
=====

It's possible that other non-letter characters could cause problems with 
Thickbox if passed unchecked to the a tag. 

Original issue reported on code.google.com by BMEM...@gmail.com on 27 Jul 2011 at 9:08

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
thanks, fixed r968

Original comment by alex.cologne on 29 Jul 2011 at 7:44