Author Topic: Additional images double quotes and backslashes in title  (Read 3627 times)

bobysolo

  • Beginner
  • *
  • Posts: 47
  • Kiss my shiny metal ass!
    • Videosorveglianza
Additional images double quotes and backslashes in title
« 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
Code: [Select]
$html .= vmCommonHTML::getLightboxImageLink( $image->file_url, $thumbtag, $title ? $title : $image->file_title, 'product'.$product_id );after
Code: [Select]
$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

  • Beginner
  • *
  • Posts: 1
Re: Additional images double quotes and backslashes in title
« Reply #2 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 ?