Make WordPress Core

Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#5105 closed defect (bug) (duplicate)

Patch (formatting.php): notice-level error is being accidentally thrown

Reported by: richcon's profile richcon Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3
Component: General Keywords:
Focuses: Cc:


The following line in formatting.php throws a notice-leve error (Uninitialized String Offset) if '$curl' is an empty string:

29: if (isset($curl{0}) && '<' != $curl{0} && $next) { If it's not a tag

Clearly, isset($curl{0}) is intended to prevent empty strings from being tested, but isset doesn't check string offsets.

Changing to the following prevents empty strings from being considered:

if ($curl && '<' != $curl{0} && $next) { If it's not a tag

Attachments (1)

formatting.php.diff (620 bytes) - added by richcon 16 years ago.

Download all attachments as: .zip

Change History (5)

#1 @foolswisdom
16 years ago

  • Keywords has-patch added
  • Milestone set to 2.4

16 years ago


#2 @darkdragon
16 years ago

Well, if you are checking to see if it is not empty, then you should use !empty().

if ( !empty($curl) && '<' != $curl{0} && $next ) { // If it isn't a tag

Should be used instead.

#3 @jacobsantos
15 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #6669

#4 @jacobsantos
15 years ago

  • Keywords has-patch removed
Note: See TracTickets for help on using tickets.