Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the email and href parsing regexes a little. Also add descrip…
…tive comments since regexes are rarely capable of standing on their own. Read the comments for details on the new rules but I tested them pretty thoroughly and they seem to work satisfactorily. Let me know if anyone finds issues. Note that we really need to do this with a parse tree. Or at least replace the urls and emails with some marker and then put them back in later. Parsing the whole thing repeatedly caused me all kinds of problems like emails matching already matched URLs, having to match entities instead of the real characters, etc. These problems force us to tighten the rules used to match emails (like enforcing a subset of characters preceding email addresses). I may do this at some point but not now. * core/string_api.php (string_insert_hrefs): redo regexes to be more comprehensive (string_strip_hrefs): match much more generally, including href anchors with other attributes or extraneous whitespace git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2106 f5dc347c-c33d-0410-90a0-b07cc1902cb9
- Loading branch information