Ticket #4226 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

missing regex delimiter

Reported by: Mittineague Assigned to: rob1n
Priority: normal Milestone: 2.2
Component: General Version: 2.1.3
Severity: normal Keywords: wp-mail, regex
Cc:

Description (Last modified by rob1n)

E_WARNING preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Delimiter must not be alphanumeric or backslash at /path/to/wordpress/wp-mail.php (59) timed at 04-May-2007 19:23:34

// Set the author using the email address (To or Reply-To, the last used)
// otherwise use the site admin
if (preg_match('/From: /', $line) | preg_match('Reply-To: /', $line))  {
	$author=trim($line);

Should be .... '/Reply ....

Change History

05/05/07 00:02:08 changed by Mittineague

Oops, please remove my domain path stuff and this comment, Thanks

05/05/07 00:04:19 changed by rob1n

  • owner changed from anonymous to rob1n.
  • status changed from new to assigned.
  • description changed.
  • milestone changed from 2.4 to 2.3.

No problem.

05/05/07 00:07:47 changed by rob1n

  • status changed from assigned to closed.
  • resolution set to invalid.
  • milestone deleted.

I can't find such lines in 2.0, 2.1, 2.2 or trunk (2.3). Either it's a plugin (unlikely, since it's in a core file) or you're running a very old version. In which case my only fix is to upgrade ;).

05/05/07 02:12:01 changed by Mittineague

  • status changed from closed to reopened.
  • resolution deleted.

Perhaps the reformatting (newlines were removed) of the code lines misled. I have the same lines in the wp-mail.php file in WordPress versions 2.0.7, 2.1, 2.1.1, 2.1.2, and (I think it's the most recent version) 2.1.3 The code should look like more this (extra newlines added)

// Set the author using the email address (To or Reply-To, the last used)

// otherwise use the site admin

if (preg_match('/From: /', $line) | preg_match('Reply-To: /', $line)) {

$author=trim($line);

05/05/07 02:42:30 changed by rob1n

  • milestone set to 2.2.

05/05/07 02:42:55 changed by rob1n

My mistake. Apologies. I'll put a fix in for this in a bit.

05/05/07 02:51:21 changed by rob1n

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [5396]) Add in missing delimiter. fixes #4226 for 2.0, 2.2 and 2.3

05/05/07 02:53:37 changed by rob1n

  • description changed.