#7133 closed defect (bug) (fixed)
maybe_serialize does not match with maybe_unserialize
| Reported by: | hakre | Owned by: | westi |
|---|---|---|---|
| Priority: | high | Milestone: | 2.6 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
maybe_serialize is used in conjunction with maybe_unserialize. from a logical point of view, data passed through both functions should be returned unchanged:
<?php
$data_original = ' original ';
$data = maybe_serialize($data_original);
$data = maybe_unserialize($data);
printf('Original:"%s" Processed:"%s"', $data_original, $data);
?>
the output is:
Original:" original " Processed:"original"
this example shows that data has been unecessarily manipulated.
when you look into the code you can see that maybe_serialize() trims the $data. this is of no use.
# to trim a string use trim() php function
# serialization is about arrays and objects, not strings
Attachments (2)
Change History (7)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch so solve the Problem