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 (from r96826)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112088 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sminnee 2010-10-13 02:27:21 +00:00
parent e013e7512b
commit e8bb141aaa

View File

@ -924,12 +924,11 @@ PHP
}
}
function createFile($filename, $content) {
$base = $this->getBaseDir();
$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;
} else {
$this->error("Couldn't write to file $base$filename");