Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#13853 closed defect (bug) (fixed)

PHP Notice from undefined offset in revisions compare

Reported by: filosofo Owned by: westi
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Revisions Keywords: has-patch
Focuses: Cc:


Patch checks to make sure it's defined, otherwise setting it to blank.

Attachments (2)

undefined-offset-in-revisions.13853.diff (1.3 KB) - added by filosofo 8 years ago.
revisions.png (77.1 KB) - added by filosofo 8 years ago.

Download all attachments as: .zip

Change History (6)

#1 @westi
8 years ago

  • Keywords reporter-feedback added
  • Owner set to westi
  • Status changed from new to accepted

How does one trigger the notice?

8 years ago

#2 @filosofo
8 years ago

  • Keywords reporter-feedback removed

See revisions.png. I'm not sure exactly how to reproduce, but it may be comparing a blank line with 2 or more.

Nevertheless, the logic error in the code is plain: it assumes an array index is defined without warrant.

#3 @dd32
8 years ago

I've hit this many times before, never got around to patching it.

  1. Create a new post, leave the content blank (Insert a space if need be, makes no difference)
  2. Update the content with a sentence.
  3. Compare the Revisions.

#4 @dd32
8 years ago

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

(In [15246]) Fix PHP Notice in Revisions comparison. Props filosofo. Fixes #13853

Note: See TracTickets for help on using tickets.