Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-13814

phpbb_is_writable() method of the new filesystem class truncates files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.2.0-a1
    • 3.2.0-dev
    • Other

      phpbb_is_writable() method of the filesystem class truncates files when trying to check for wtitability here:
      https://github.com/phpbb/phpbb/blob/master/phpBB/phpbb/filesystem/filesystem.php#L616
      The cause is that fopen call parameter was changed from 'r+' to 'w'. The latter causes truncating files, see http://php.net/manual/en/function.fopen.php

      'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.

      This can lead to f.e. truncating config.php when entering ACP main page.

            nicofuma nicofuma
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: