FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » From header parsing issue
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
From header parsing issue [message #187619] Wed, 07 November 2018 08:52
Zrubi is currently offline  Zrubi   Hungary
Messages: 5
Registered: November 2018
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Hi,

I'm using the auto accout create feature, where the email address and the username are parsed from the From header.
It seem to fail where the header looks like this:
"From: <username(at)domain(dot)name>"

the result are:
email: <username(at)domain(dot)name>
login: <username
name: <username


I have found a simple fix for this issue:
// Fetch From email and possible name.
- if (preg_match('!(.+?)<(.+?)>!', $this->headers['from'], $matches)) {
+ if (preg_match('!(.*)<(.+)>!', $this->headers['from'], $matches)) {
$this->from_email = trim($matches[2]);

It seems working for me - however I really don't get that original regex pattern
why those '?' characters was needed in the pattern?

[Updated on: Wed, 07 November 2018 11:16]

Report message to a moderator

Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: No Smilies!
Next Topic: Subject parsing improvement
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Oct 04 20:51:36 EDT 2024

Total time taken to generate the page: 0.08495 seconds