Closed (works as designed)
Project:
Mail Comment
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2012 at 21:27 UTC
Updated:
18 Aug 2013 at 05:38 UTC
I have read this post (http://drupal.org/node/1188584#comment-5123184) and the patch you committed to 6.x and yet I have noticed that nothing is being stripped on import when setting the filter to aggressive. Also didn't strip anything when set to Basic.
I was able to alter the aggressive strip code and put a version in my template to strip unwanted text, but this is time consuming and leaves unwanted text in the database.
code used in template:
$delimiters = array(
"On \d{1,2}[\/\-]{1}\d{1,2}[\/\-]{1}\d{1,2},", // Gmail form 1
"On \w{3}, \w{3} \d{1,2}, \d{4} at \d{1,2}:\d{1,2} [AP]M", // Gmail form 1
"On \w{3}, \w{3} \d{1,2}, \d{4} at \d{1,2}:\d{1,2} [AP]M", // Gmail form 2
"On \d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{1,2} [AP]M,", // Thunderbird
"On [A-Z][a-z]{2} [0-9]{1,2}, [0-9]{4}, at [0-9]{1,2}:[0-9]{2} [AP]M, [a-zA-Z0-
9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4} wrote", // Mac mail
"On [A-Z][a-z]{2} [0-9]{1,2}, [0-9]{4}, at [0-9]{1,2}:[0-9]{2} [AP]M,", // Mac
mail
"---", // Outlook express and Yahoo
"From:(\s*)[A-Za-z0-9._%+-]+@[A-Za-z0-9._%+-]+\.[A-Za-z]{2,3}(\s*)\[mailto:[A-Za-z0-9._%+-]+@[A-Za-z0-9._%+-]+\.
[A-Za-z]{2,3}\]", // Outlook legacy
"From:.*Sent:.*To:.*Subject:", // Fallback
"\(\(\( Reply", // Default comment
"___", // Some signature beginning
);
$expression = '/('. implode('|', $delimiters) .')/i';
$matches = array();
if (preg_match($expression, $content, $matches, PREG_OFFSET_CAPTURE)) {
$strcomment = substr($content, 0, $matches[0][1]);
print $strcomment;
} else {
print $content;
}
Any help would be great.
Thank you,
Larry
Comments
Comment #1
danepowell commentedPlease post an example message that is not being properly stripped.
Comment #2
rajeevkI am also getting the same problem.
As you have asked above to paste the content where this aggressive filter is not working, so I am giving you one example:-
----------------------------------------------------------------------------------------------------------------------------
Can you use delimitor ?
On Mon, May 14, 2012 at 6:15 PM, Konnected" <
enablingdimensionspost@gmail.com> wrote:
>
>
> Konnected
>
> *** REPLY ABOVE THIS LINE TO POST A COMMENT *** *Project: Konnected
> *
> *Rajeev** *posted a new *Message:*
>
> Testing after change of trim...
> On Mon, May 14, 2012 at 6:05 PM, Konnected" <
> enablingdimensionspost@gmail.com> wrote:
> >
> >
> > Konnected
> >
> > *** REPLY ABOVE THIS LINE TO POST A COMMENT *** *Project: Konnected
> > *
> > *Rajeev** *posted a new *Message:*
>
> >
> >
> > Checking DPM for $marker...
> > On Mon, May 14, 2012 at 6:04 PM, Konnected" <
> > enablingdimensionspost@gmail.com> wrote:
> > >
> > >
> > > Konnected
> > >
> > > *** REPLY ABOVE THIS LINE TO POST A COMMENT ****Project: Konnected
> > > *
> > > *admin* updated *Message:*
> > >
> > > *Message Title: I am testing for delimitor*
> >
> > >
> > > This is for impode testing....
> > >
> > >
> > > *BY THIS MAIL ITSELF****
> >
> > >
> > > Read more at: http://edlabs.in/connect/node/1849.
> > >
> > >
> > > --This is an automatic message from Konnected To manage your
> > > subscriptions, browse to
> > http://edlabs.in/connect/user/88/notificationsView original post:
> > >
> http://edlabs.in/connect/mailcomment/redirect/%3C88.1849.0.1336981302.08
> > ...
> > >
> > >
> > >
> > >
> > --
> > Rajeev Kumar,
> > Software Developer,
> > Enabling Dimensions(I) Pvt. Ltd.,
> > Mobile - +91-9650361380,
> > E-Mail - Rajeevk@enablingdimensions.com,
> > Website - www.enablingdimensions.com
> >
> >
> >
> >
> > Read more at: http://edlabs.in/connect/node/1849#comment-960 or reply
> via
> > http://edlabs.in/connect/comment/reply/1849/960--This is an automatic
> > message from Konnected To manage your subscriptions, browse to
> > http://edlabs.in/connect/user/88/notifications View original post:
> > http://edlabs.in/connect/mailcomment/redirect/%3C88.1849.960.1336998914
> ....
> >
> >
> >
> >
> --
> Rajeev Kumar,
> Software Developer,
> Enabling Dimensions(I) Pvt. Ltd.,
> Mobile - +91-9650361380,
> E-Mail - Rajeevk@enablingdimensions.com,
> Website - www.enablingdimensions.com
>
>
>
>
> Read more at: http://edlabs.in/connect/node/1849#comment-961 or reply via
> http://edlabs.in/connect/comment/reply/1849/961--This is an automatic
> message from Konnected To manage your subscriptions, browse to
> http://edlabs.in/connect/user/88/notifications View original post:
> http://edlabs.in/connect/mailcomment/redirect/%3C88.1849.961.1336999475....
>
>
>
>
--
Rajeev Kumar,
Software Developer,
Enabling Dimensions(I) Pvt. Ltd.,
Mobile - +91-9650361380,
E-Mail - Rajeevk@enablingdimensions.com,
Website - www.enablingdimensions.com
--------------------------------------------------------------------------------------------------------------------------
I have imported this from mail where only first line should come as comment (Can you use delimitor ?)
Even simple filter is also not working. I hope this helps you...
Thanks,
RajeevKr
Comment #3
danepowell commentedComment #4
rajeevkHello Dane,
How are you ?
Tell me what information you are needed, may be I can help you. I can give you exact information which I am using...you just ask what are the information you need..
Even you can chat with me..
Thanks,
RajeevKr
Comment #5
danepowell commentedI've had other reports of broken filters, so I'll need to investigate and get back to you.
Comment #6
danepowell commentedIf you were importing the plain text body, can you try 6.x-2.x-dev? This might be solved by #2006862: Message cleaning not applied to plain text
Comment #7
rajeevkI am not using this module anymore.
I have made some mechanism from myself to post content & comment from my custom module.
Thanks,