VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: communion on July 11, 2012, 05:56:06 AM

Title: VM admin strips simple html tags out of fields when saving
Post by: communion on July 11, 2012, 05:56:06 AM
This may be a Virtuemart 2 issue, but certain fields accept simple html tags, others are stripped. Is there a Joomla override to prevent html tags being stripped out of admin fields?

Thanks in advance
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: communion on July 14, 2012, 00:14:56 AM
Does anyone have any idea about this? I need to format some things with line breaks, they are stripped out of admin fields when saved. Such as "Image Description" input box.

Thanks in advance.
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: John2400 on July 14, 2012, 04:36:38 AM
sometimes this is your editor in Joomla - in global configuration - you could update your editor - (free) .

or turn off your editor and copy and paste -

or hunt for the html  -- in joomla forums

or go to joomla global configuration ->>text filter >>superuser ( you) >> set >>no filtering

Title: Re: VM admin strips simple html tags out of fields when saving
Post by: communion on July 15, 2012, 03:32:01 AM
That's not the issue. I'm not talking about editor windows because I don't use TinyMCE, and have the system plugin disabled.

I'm referring specifically to the input fields in the Photo description areas, title etc.

See I have VM using prettyPhoto which pulls the Image description as the title and when I add line breaks <br /> they get stripped out when I save the product.

Can anyone else on the VM team answer this?

Thanks in advance.
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: John2400 on July 15, 2012, 06:33:23 AM
I added <p> and </p>  at the beginning and end of the pasted code and they held.
I tried prettyphoto , flash, youtube , single and group images.
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: communion on July 16, 2012, 02:06:07 AM
Hi, thanks for your response. I tried this, it doesn't work in this field:  Displayed image title

This is the image title that is pulled into prettyPhoto. Any ideas?
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: John2400 on July 16, 2012, 09:59:15 AM
I am using JCE version 2.2.3 text editor - in the product description area. 
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: communion on July 17, 2012, 01:19:33 AM
Yeah that's exactly my question. Why are tags acceptable in product description <textarea> but not in <inputbox>

Can someone answer this?
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: jenkinhill on July 17, 2012, 18:21:58 PM
For processing the image description VM uses the following code in media.php:

JRequest::getVar('file_description','','post','STRING',JREQUEST_ALLOWHTML);

As you see Joomla is instructed to allow some HTML in the entry - JREQUEST is an instruction to Joomla, see http://docs.joomla.org/Retrieving_and_Filtering_GET_and_POST_requests_with_JRequest::getVar

Sounds like your code is being sanitized somewhere, not sure if this is in Joomla or VM
Title: Re: VM admin strips simple html tags out of fields when saving
Post by: perlarenee on August 14, 2012, 21:27:53 PM
in older forums they were referring to a blacklist...i'm not sure if that might be the case in vm2 as well