Ticket #7201 (closed defect (bug): duplicate)

Opened 6 months ago

Last modified 6 months ago

Dead code in maybe_serialize function

Reported by: jacobsantos Assigned to: 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

4029.testcases.diff (2.7 kB) - added by jacobsantos on 06/28/08 18:42:02.
Test cases for maybe_serialize()

Change History

06/28/08 18:42:02 changed by jacobsantos

  • attachment 4029.testcases.diff added.

Test cases for maybe_serialize()

06/28/08 18:42:54 changed by jacobsantos

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

06/28/08 18:43:48 changed by jacobsantos

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.

06/29/08 20:02:44 changed by jacobsantos

  • keywords changed from has-patch needs-testing to needs-patch needs-testing dev-feedback.

07/12/08 11:33:34 changed by westi

  • owner changed from anonymous to westi.
  • status changed from new to assigned.

07/18/08 19:06:37 changed by santosj

  • status changed from assigned to closed.
  • resolution set to duplicate.
  • milestone deleted.

Duplicate of #7347.

07/18/08 19:06:46 changed by santosj

  • keywords deleted.