Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Very nice module but a little bug in views_slideshow_imageflow.theme.inc on line 22 :
preg_match('@<\s*a\s+href\s*=\s*"\s*([^"]+)\s*"[^>]*>[^<]*'. $image .'[^<]*<\s*/a\s*>@i', $item, $urls);
must be replaced by :
preg_match('@<\s*a\s+href\s*=\s*"\s*([^"]+)\s*"[^>]*>[^<]*'. preg_quote($image) .'[^<]*<\s*/a\s*>@i', $item, $urls);
You must use preg_quote in image string else special chars will break the preg_match pattern and no link will be found.
Comments
Comment #1
kanani CreditAttribution: kanani commented+1 on this fix working.
Prior to the updates clicking on the image just displayed the image full size(as if I did a right click "view image").
After changing the line, clicking on image loads the node the image is coming from.
Thanks sinasquax.
Comment #2
aaron CreditAttribution: aaron commentedThanks for the fix, sinasquax! Committed the change in the dev version. Will make a beta release soon.
Comment #4
EdinburghRob CreditAttribution: EdinburghRob commentedI've come across a case where the preg_quote function doesn't quite do it. One of my users put an @ sign in the description of the image and it resulted in the following error message:
warning: preg_match() [function.preg-match]: Unknown modifier 'T' in views_slideshow_imageflow.theme.inc on line 22.
The offending $image string is
If I remove the @ signs it all works fine.
Using preg_quote the output is
Note how the @ sign doesn't get escaped.
So
Must be replaced with:
I'm not sure if there are more characters which would break this though...
Best wishes,
Rob