Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4226 closed defect (bug) (fixed)

missing regex delimiter

Reported by: mittineague's profile Mittineague Owned by: rob1n's profile rob1n
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.1.3
Component: General Keywords: wp-mail, regex
Focuses: 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 (8)

#1 @Mittineague
17 years ago

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

#2 @rob1n
17 years ago

  • Description modified (diff)
  • Milestone changed from 2.4 to 2.3
  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned

No problem.

#3 @rob1n
17 years ago

  • Milestone 2.3 deleted
  • Resolution set to invalid
  • Status changed from assigned to closed

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 ;).

#4 @Mittineague
17 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

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);

#5 @rob1n
17 years ago

  • Milestone set to 2.2

#6 @rob1n
17 years ago

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

#7 @rob1n
17 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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

#8 @rob1n
17 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.