How to filter unwanted strings within a form's textarea?
I need my local users to create content using html tags within a textarea, but I don't want them to include links to external images resources. My idea is to enable a filter that looks for the "http://www.whatever_ext_site.com" string within the img tag, and then erase it before posting the whole form data to the proper method. Is there a simple way for doing this? (If not, what is the hard way? :) ) Thanks in advance, Ausum
On Thu, 12 Jul 2001, Ausum wrote:
I need my local users to create content using html tags within a textarea, but I don't want them to include links to external images resources.
My idea is to enable a filter that looks for the "http://www.whatever_ext_site.com" string within the img tag, and then erase it before posting the whole form data to the proper method.
Is there a simple way for doing this? (If not, what is the hard way? :) )
The hardway would be to parse html yourself using sgmllib and remove img tags. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Chris Withers has a product to do this on zope.org. Sorry, I can't remember the name at the moment but a search for 'HTML' and 'filter' will probably find it. --On Thursday, July 12, 2001 08:43:54 AM -0500 Ausum <augusto@artlover.com> wrote:
I need my local users to create content using html tags within a textarea, but I don't want them to include links to external images resources.
My idea is to enable a filter that looks for the "http://www.whatever_ext_site.com" string within the img tag, and then erase it before posting the whole form data to the proper method.
Is there a simple way for doing this? (If not, what is the hard way? :) )
Thanks in advance,
Ausum
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
"Dan L. Pierson" wrote:
Chris Withers has a product to do this on zope.org. Sorry, I can't remember the name at the moment but a search for 'HTML' and 'filter' will probably find it.
http://www.zope.org/Members/chrisw/stripogram (or different capitalisations thereof ;-) cheers, Chris
Look at stripogram from Chris Withers, it does the hard work and parses HTML tags for you. http://www.zope.org/SiteIndex/search?text_content=stripogram -- Andy McKay ----- Original Message ----- From: "Ausum" <augusto@artlover.com> To: <zope@zope.org> Sent: Thursday, July 12, 2001 6:43 AM Subject: [Zope] How to filter unwanted strings within a form's textarea?
I need my local users to create content using html tags within a textarea, but I don't want them to include links to external images resources.
My idea is to enable a filter that looks for the "http://www.whatever_ext_site.com" string within the img tag, and then erase it before posting the whole form data to the proper method.
Is there a simple way for doing this? (If not, what is the hard way? :) )
Thanks in advance,
Ausum
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (5)
-
Andy McKay -
Ausum -
Chris Withers -
Dan L. Pierson -
Oleg Broytmann