Moodle

workaround for php bug http://bugs.php.net/bug.php?id=44792

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Events API
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE

Description

when serializing php objects that include private and protected member variables, php puts null bytes on either side of an * to denote visibility.

See: http://bugs.php.net/bug.php?id=44792

The workaround as far as I can see is to base64_encode and decode serialized data before sticking it in the database.

I am adding this to the event lib code because I can see that's an obvious place that we're going to be affected by this. Anything that wants to store both state and functionality (eg code) for waking up later is going to probably be affected, so we might eventually want moodle_serialize and moodle_unserialize if we find this to be a more widespread problem.

Another place this is potentially going to affect us is for database sessions. (which according to Petr aren't working in HEAD anyway at the moment)

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

adding Petr here to let him know

Show
Eloy Lafuente (stronk7) added a comment - adding Petr here to let him know
Hide
Petr Škoda (skodak) added a comment -

my +1 for "standard" moodle_serialize, potential places are:

1/ events
2/ modinfo
3/ blocks config - there could be a problem with bc in backups

Show
Petr Škoda (skodak) added a comment - my +1 for "standard" moodle_serialize, potential places are: 1/ events 2/ modinfo 3/ blocks config - there could be a problem with bc in backups
Hide
Petr Škoda (skodak) added a comment -

The biggest problem here is that we should not be serialising full classes. So technically this should not cause any problems. The current workaround works fine. Closing for now.

Thanks for the report.

Show
Petr Škoda (skodak) added a comment - The biggest problem here is that we should not be serialising full classes. So technically this should not cause any problems. The current workaround works fine. Closing for now. Thanks for the report.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: