mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
BUGFIX #4791 Potential issue with creating files in SS installer on IIS - use the "b" mode when using fopen() to be more portable on platforms
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@96826 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0f45be4ccd
commit
6015195223
@ -924,12 +924,11 @@ PHP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function createFile($filename, $content) {
|
function createFile($filename, $content) {
|
||||||
$base = $this->getBaseDir();
|
$base = $this->getBaseDir();
|
||||||
$this->statusMessage("Creating $base$filename");
|
$this->statusMessage("Creating $base$filename");
|
||||||
|
|
||||||
if((@$fh = fopen($base . $filename, 'w')) && fwrite($fh, $content) && fclose($fh)) {
|
if((@$fh = fopen($base . $filename, 'wb')) && fwrite($fh, $content) && fclose($fh)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$this->error("Couldn't write to file $base$filename");
|
$this->error("Couldn't write to file $base$filename");
|
||||||
|
Loading…
Reference in New Issue
Block a user