WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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:

Description

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 5 years ago.
revisions.png (77.1 KB) - added by filosofo 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 @westi5 years ago

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

How does one trigger the notice?

@filosofo5 years ago

comment:2 @filosofo5 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.

comment:3 @dd325 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.

comment:4 @dd325 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.