Converting email which has 2 or more newlines before it

Ilmar - April 17, 2009 - 13:45
Project:Bbcode
Version:5.x-2.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

There is a problem with converting plaintext email into the link when there are 2 or more newlines before the email. E.g.

<!-- 2 newlines before email -->

test@example.com

will be converted in _bbcode_filter_process function into
<p>test@example.com</p>

and after that conversion into the link will fail b/c the regular expression which converts emails into links expects emails to start with tabulation, new line or empty space (see line 256).

I've implemented a workaround for this (see patch) but I feel that this solution should be more generic, like processing the links at the beginning of the filter process but I don't know how this can be done correctly.

AttachmentSize
email_substituting.patch2.24 KB
 
 

Drupal is a registered trademark of Dries Buytaert.