Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7201 closed defect (bug) (duplicate)

Dead code in maybe_serialize function

Reported by: jacobsantos Owned by: westi
Priority: low Milestone:
Component: General Version: 2.5
Severity: trivial Keywords:
Cc:

Description

Looking at the code of maybe_serialize() caused some confusion, because it doesn't appear that the code will ever execute as the first if branch will always evaluate serialized data to be true. This means that when the execution gets down to

    if ( is_serialized( $data ) )   // <--- Always false
        return serialize( $data );  // <--- Dead Code

This probably needs to be moved up a bit to the top of the function body.

Attachments (1)

4029.testcases.diff (2.7 KB) - added by jacobsantos 5 years ago.
Test cases for maybe_serialize()

Download all attachments as: .zip

Change History (7)

Test cases for maybe_serialize()

The test cases need to be patched in the wp-testcases folder in the Automattic WordPress Tests repository.

There has been a previous discussion on the topic in #4029 and I suppose the expected result is that serialized data should be serialized again.

  • Keywords needs-patch dev-feedback added; has-patch removed
  • Owner changed from anonymous to westi
  • Status changed from new to assigned
  • Milestone 2.7 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #7347.

  • Keywords needs-patch needs-testing dev-feedback removed
Note: See TracTickets for help on using tickets.