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

$CFG->filelifetime = 0 has no effect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2
    • Fix Version/s: 1.8.3, 1.9
    • Component/s: Resource
    • Labels:
      None
    • Environment:
      Any
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Setting $CFG->filelifetime = 0 in config.php has no effect. This is because file.php checks to see if $CFG->filelifetime is empty. In PHP, empty(0) is true, which means your filelifetime is set to 86400, the default.

      The workaround is to set $CFG->filelifetime = 1, but I think file.php should check to see if (!isset($CFG>filelifetime)) as per the attached patch. The value would be consistently applied throughout its possible range.

        Attachments

        1. file.php.patch
          0.6 kB
          Chris Fryer
        2. filelib.php.patch
          1 kB
          Chris Fryer

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Oct/07