Hi,

I have an issue with Simplenews combined with Spamspan, this probably is general filter related.
The problem is, Spamspan filters mailadresses, and replaces @ by [at] and . by [dot]. For preventing spam harvesting.

The online issue looks good, because spamspam javascript applies. The send issue shows the filtered, unclickable mailadres[at]domain[dot]tld.

Is there a way to have best of both? So that the filter applies on the online issue, and not on the send issue?

Thanks a lot.

Kees

Comments

sutharsan’s picture

Status: Active » Closed (fixed)

Filters are applied to node body also on node being send by email. It should be possible to make this exception but not by Simplenews only by the applicable filter.

osopolar’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Status: Closed (fixed) » Needs work

I have the same issue and was looking for how to fix it. I don't think that this could be done by the filter itself because simple news have to provide some informations to the hook_filter. How would the filter know that it is filtering in mail context and not node view?

I propose to add the possibility to choose a filter for the mail send by simple news. The settings (in admin/settings/simplenews/newsletter) should contain a selection field or all available filters options + one (default) called "use node's format". Now the developer can just create a filter to use for newsletter mails (which could be different to the newsletter node filter).

osopolar’s picture

Version: 6.x-1.x-dev » 6.x-1.3
Status: Needs work » Needs review
StatusFileSize
new1.9 KB

Patch for the in #2 described changes.

Created for Version 6.x-1.3 but will also work for current 6.x-2.x-dev.

miro_dietiker’s picture

Note that as of Drupal features what you refer to is named "input filters".
This means we're choosing the format of input (input language / syntax).

Simplenews even introduces an own build type for the output. Thus it would allow build processes to detect the output channel.
The issue now is not simplenews implementation, but much more an architectural deficit of drupal. Namely the lack of context in filter processing. There already have been many many feature requests to fix this in core.
#226963: Context-aware text filters (provide more meta information to the filter system)
#696380: Pass node context to filters
#11225: Node context for filters
^^ note the date!
Ans also note that it has been delayed to 8.x due to the lack of pressure.

What you introduce is much more a workaround - not a clean implementation - which changes the meaning of filters. At least it's a feature request this time which happens to be subject of 6.x-2.x or 7.x.

Is it impossible to check for the build mode? We should look for a cleaner drupal-like implementation to be integrated.

osopolar’s picture

Version: 6.x-1.3 » 6.x-2.x-dev
Category: support » feature

Input filter means that the input has to run through that filter. Drupal is storing the input "as is" to the database (no filtering, only some sql escaping) and filters while preparing it for output.

I have seen that build type but I can't use it in the filter because it can't be used by the input filter because the filters are not context aware (#226963: Context-aware text filters (provide more meta information to the filter system)).

IMHO there won't be ever a fix for the filter issue in drupal 6.x. But I'd like to get this fixed for Simplenews 6.x.

As far as I can see you don't like the way I fixed it. I can't see in which way it changes the meaning of filters. It changes (extends) the way how filters are used, if the site developer wants -- therefore the default option is to use the nodes input filter (set in $node->format).

simon georges’s picture

Status: Needs review » Closed (won't fix)

As this should not be handled by Simplenews core, and the issue has not been touched in more than 6 months, I'm closing it.

osopolar’s picture

Version: 6.x-2.x-dev » 6.x-2.0-alpha5
StatusFileSize
new1.83 KB

Fixed: Patch in 3 did not work if anonymous has no right to use filter ... as this is ment for node creation I dropped it out. Now it works well.

vistree’s picture

Hi, is there an equal path for drupal 7?