Bug Style archive import may not update files atomically

There is a bug in this version
K

Kirby

Guest
When importing a style archive, XenForo may copy files over existing files.
This operation is not atomic and thus those files may be accessed by a client in an inconsistent state (eg. half-written).

XF\Service\Style\ArchiveImport::copyAssetFiles
Code:

Code:
if ($this->rewriteAssetPaths)
{
    File::copyFileToAbstractedPath($pathname, $dataUriPrefix . $stdPath);
}
else
{
    $newPathPrefix = \XF::getRootDirectory() . $DS;
    File::copyFile($pathname, $newPathPrefix . $stdPath);
}

While there...

Read more

Continue reading...