Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-22725

admin/replace.php breaks serialised data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 1.9.9, 2.0
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      Serialised data breaks when using the migration approach documented by http://docs.moodle.org/en/Moodle_migration

      Either using /admin/replace.php or `sed` causes the issue.

      The severity of the issue depends on what string you are replacing. In PHP 5.1.6, if you edit serialised data and replace a string with one of different length without updating the s:<number>: value to the new length, it will throw a warning and return false. In PHP 5.2.10 it put up with the incorrect length and worked anyway.

      If the problem is effecting the course.modinfo field you can simply update mdl_course set modinfo='' to fix. The issue effected a third party block I was using (course_menu block) which used serialised data and contained a URL which I was replacing, causing the block to crash out and not display.

      I checked all core code for other uses of unserialise. There are some serialised fields stored in mnet as well as gradebook preferences which could break if they get tampered with.

      Thanks

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: