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:
sharvey 2010-01-13 00:30:44 +00:00 committed by Sam Minnee
parent 0f45be4ccd
commit 6015195223

View File

@ -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");