I would like to be able to embed a PayPal donations button, but I can't get it to work. I found this post where some possibilities are mentioned: http://stackoverflow.com/questions/3189396/whitelist-forms-in-html-purif...

I was able to allow HTML.Trusted using the HTML Purifier (advanced) input filter, but to no avail. Could somebody give me a hint?

Comments

ezyang’s picture

Status: Active » Fixed

Did you clear your cache after making the configuration change? That's the usual issue, see #923262: Configuration change does not clear the cache (One easy way to do testing is to tweak the content under test a little bit, so Drupal is forced to rerun the configuration filter.)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AndrewPurdy’s picture

The easiest way I found to add a PayPal donation button is as follows:

1) Create a block for the donations and position it as necessary, e.g. Right Sidebar

2) In the 'Block Body' of the block add the Button code as generated by PayPal and make the 'Input Format' Full HTML

3) In Configuration/Input Formats I enabled 'Full HTML' so that it could be used by the various Roles I had set up.

yan’s picture

Status: Closed (fixed) » Active

#1
Yes, caches have been cleared. But the button still doesn't work.

#3
Are you sure that you are using HTML Purifier as an input filter in your Full HTML settings? It seems to me, you're talking about something different (no offense!).

ezyang’s picture

Status: Active » Postponed (maintainer needs more info)

Can you post the precise code that is submitted to Drupal? Can you post the code that is given to HTML Purifier? (you can do this by intercepting the call to HTML Purifier and having it print out the contents, before and after.)

yan’s picture

Can you post the code that is given to HTML Purifier? (you can do this by intercepting the call to HTML Purifier and having it print out the contents, before and after.)

How would I do that "interception"?

heddn’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Here's a walkthrough that *should* get this working. These instructions can really apply to any random HTML loaded into a block in both D6 & D7.

  1. Set these input filters: HTML Purifier Advanced, HTML filter, line break converter (optional), URL filter (optional)
  2. Configuration
  3. Filter HTML Tags
    - Strip disallowed tags radio option
    - Allowed html tags for paypal's buttons as a minimum: <form> <img> <input>. If you are trying to post other than paypal's html content in the block, then the allowed tags will/may be different.
    HTML Purifier
    -HTML.Trusted = true
    - URI.DisableExternalResources = false This allows paypal's logo image to be served up from their external domain. If you are hosting the image on your server then no need for this setting.

  4. Clear HTML Purifier cache
heddn’s picture

I just learned something new about HTML Purifier that I thought I would add to my previous posting. Instead of using the drupal html filter, you can disable it and use html purifier's. See HTML.Allowed, HTML.AllowedAttributes, etc. http://htmlpurifier.org/live/configdoc/plain.html#HTML. It is much more powerful than Drupal's.