mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Use 'b' mode for fopen() where possible for better portability
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98321 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7de75919ac
commit
a93d12cf31
@ -13,7 +13,7 @@ class XML extends Object {
|
|||||||
|
|
||||||
function tidyXHTML($content) {
|
function tidyXHTML($content) {
|
||||||
$cleanFile = TEMP_FOLDER . "/cleaner.tmp";
|
$cleanFile = TEMP_FOLDER . "/cleaner.tmp";
|
||||||
$fh = fopen($cleanFile,"w");
|
$fh = fopen($cleanFile,"wb");
|
||||||
fwrite($fh, $content);
|
fwrite($fh, $content);
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class ManifestBuilderTest extends SapphireTest {
|
|||||||
} else {
|
} else {
|
||||||
touch($baseFolder . $item);
|
touch($baseFolder . $item);
|
||||||
if($itemContent) {
|
if($itemContent) {
|
||||||
$fh = fopen($baseFolder . $item, 'w');
|
$fh = fopen($baseFolder . $item, 'wb');
|
||||||
fwrite($fh, $itemContent);
|
fwrite($fh, $itemContent);
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
}
|
}
|
||||||
|
@ -162,11 +162,11 @@ class TableListFieldTest extends SapphireTest {
|
|||||||
|
|
||||||
// Create a temporary file and write the CSV to it.
|
// Create a temporary file and write the CSV to it.
|
||||||
$csvFileName = tempnam(TEMP_FOLDER, 'csv-export');
|
$csvFileName = tempnam(TEMP_FOLDER, 'csv-export');
|
||||||
$csvFile = fopen($csvFileName, 'w');
|
$csvFile = fopen($csvFileName, 'wb');
|
||||||
fwrite($csvFile, $csvOutput);
|
fwrite($csvFile, $csvOutput);
|
||||||
fclose($csvFile);
|
fclose($csvFile);
|
||||||
|
|
||||||
$csvFile = fopen($csvFileName, 'r');
|
$csvFile = fopen($csvFileName, 'rb');
|
||||||
$csvRow = fgetcsv($csvFile);
|
$csvRow = fgetcsv($csvFile);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$csvRow,
|
$csvRow,
|
||||||
|
Loading…
Reference in New Issue
Block a user