VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: bobysolo on October 15, 2009, 23:47:26 PM

Title: Additional images double quotes and backslashes in title
Post by: bobysolo on October 15, 2009, 23:47:26 PM
If you're having problem validating your product.details pages because of double quotes in the Additional images Titles, here's the solution. Also, the backslashes don't get striped - this doesn't represent a validation problem, but still no use of backslashes in the image title.

Please developers or any PHP master, review the code, to see if it's safe and OK and maybe correct it in the next release.

Edit the file theme.php of your selected template:
before
$html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : $image->file_title, 'product'.$product_id );
after
$html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : stripslashes(htmlentities($image->file_title,ENT_QUOTES)), 'product'.$product_id );

Hope it helps someone else.

Maybe the problem could be fixed already before this point (in the getLightboxImageLink procedure or somewhere else), so that the variable called "$title ? $title : $image->file_title" would have already been stripped of double quotes.

OPENED A BUG REPORT:
http://dev.virtuemart.net/cb/issue/2755
Title: Re: Additional images double quotes and backslashes in title
Post by: aravot on February 05, 2010, 03:00:47 AM
Fixed in 1.1.5
Title: Re: Additional images double quotes and backslashes in title
Post by: bobromeo on March 07, 2010, 14:10:18 PM
I found this topic while searching for striped slashes, came across the change-log which mentioned a problem being solved like this in 2005.
I have a problem with a payment class in which I have to make a string with sha1.
Before making the string I have to cleanup the string by replacing ("\t", "\n", "\r", " ") by ''.
When I save the class en open it again, the back slashes are gone.
Hope they stay in when I'm saving this post ;-)

Q: Is this also fixed in 1.1.5 ?