News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Additional images double quotes and backslashes in title

Started by bobysolo, October 15, 2009, 23:47:26 PM

Previous topic - Next topic

bobysolo

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


bobromeo

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 ?