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

admin/replace.php breaks serialised data

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not a bug
    • 1.9.9, 2.0
    • None
    • Administration
    • 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

      Attachments

        Issue Links

          Activity

            People

              moodle.com Moodle HQ
              ashleyholman Ashley Holman
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: