From a93d12cf31549d021a72ab08c07c8ebaba384fb2 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sun, 7 Feb 2010 02:14:54 +0000 Subject: [PATCH] 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 --- integration/XML.php | 2 +- tests/ManifestBuilderTest.php | 2 +- tests/forms/TableListFieldTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/XML.php b/integration/XML.php index af1614ec0..c178a75d3 100755 --- a/integration/XML.php +++ b/integration/XML.php @@ -13,7 +13,7 @@ class XML extends Object { function tidyXHTML($content) { $cleanFile = TEMP_FOLDER . "/cleaner.tmp"; - $fh = fopen($cleanFile,"w"); + $fh = fopen($cleanFile,"wb"); fwrite($fh, $content); fclose($fh); diff --git a/tests/ManifestBuilderTest.php b/tests/ManifestBuilderTest.php index 839446cc9..89158e152 100644 --- a/tests/ManifestBuilderTest.php +++ b/tests/ManifestBuilderTest.php @@ -107,7 +107,7 @@ class ManifestBuilderTest extends SapphireTest { } else { touch($baseFolder . $item); if($itemContent) { - $fh = fopen($baseFolder . $item, 'w'); + $fh = fopen($baseFolder . $item, 'wb'); fwrite($fh, $itemContent); fclose($fh); } diff --git a/tests/forms/TableListFieldTest.php b/tests/forms/TableListFieldTest.php index 1a024f222..bb5403e25 100755 --- a/tests/forms/TableListFieldTest.php +++ b/tests/forms/TableListFieldTest.php @@ -162,11 +162,11 @@ class TableListFieldTest extends SapphireTest { // Create a temporary file and write the CSV to it. $csvFileName = tempnam(TEMP_FOLDER, 'csv-export'); - $csvFile = fopen($csvFileName, 'w'); + $csvFile = fopen($csvFileName, 'wb'); fwrite($csvFile, $csvOutput); fclose($csvFile); - $csvFile = fopen($csvFileName, 'r'); + $csvFile = fopen($csvFileName, 'rb'); $csvRow = fgetcsv($csvFile); $this->assertEquals( $csvRow,