Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-13814

phpbb_is_writable() method of the new filesystem class truncates files

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: