Markup: Gallery Image bug
Posted: Wed Jun 06, 2007 1:38 pm
Have found a bug in the plugin for Gallery Markup. (serendipity_event_galleryimage.php)
I’m using gallery2 and have found the plug in does not work correctly if you have albums within albums (i.e. subalbums).
Have traced this back to two issues.
One
When the plugin parses the markup, it uses a regex to generate a url. If the markup is:
the url for the image is generated as:
instead of
The regex is on line 421:
I’m a bit out of practice for correcting the regex, so would be great if some could have a look at what it should be (otherwise I’ll look when I have more time).
Two
Even if manually correct the image url, the image does not display due to the way the url is parsed by the event_hook function.
When it parses it, album=ablum/subablum has the / removed, so can not find the image.
This can be corrected by removing line 351:
Thanks
Scott
http://zone3.net.nz/[/quote]
I’m using gallery2 and have found the plug in does not work correctly if you have albums within albums (i.e. subalbums).
Have traced this back to two issues.
One
When the plugin parses the markup, it uses a regex to generate a url. If the markup is:
Code: Select all
[GImage]album/subablum/image[/GImage]Code: Select all
http://site//plugin/g2wrapper?album=ablum&image= subablum/image&ext=jpgCode: Select all
http://site//plugin/g2wrapper?album=ablum/subablum &image=image&ext=jpgCode: Select all
$output = preg_replace("'\[GImage\s*([^\]]*)]([^\/]*)/([^\.<]*)\.*([^<]*)\[/GImage]'$preg_flags", "\$this->gimage_thumb('\\2', '\\3', '\\4', trim('\\1'))", $text);Two
Even if manually correct the image url, the image does not display due to the way the url is parsed by the event_hook function.
When it parses it, album=ablum/subablum has the / removed, so can not find the image.
This can be corrected by removing line 351:
Code: Select all
$album = str_replace("/", "", $album);Thanks
Scott
http://zone3.net.nz/[/quote]