From 0499b17c5eb91f4f35cec799830738164a897ab5 Mon Sep 17 00:00:00 2001
From: Fabian Becker <fabian.becker@uni-tuebingen.de>
Date: Wed, 21 Aug 2013 20:01:54 +0200
Subject: [PATCH] Downgrade json_encode to 5.3 for now (ommit
 JSON_UNESCAPED_UNICODE and JSON_PRETTY_PRINT) Adjust TranslationWriterTest

fixes #4086
---
 core/TranslationWriter.php                   |  5 ++++-
 tests/PHPUnit/Core/TranslationWriterTest.php | 12 +-----------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/core/TranslationWriter.php b/core/TranslationWriter.php
index f7f8dfa1c0..bf468cdbfa 100644
--- a/core/TranslationWriter.php
+++ b/core/TranslationWriter.php
@@ -107,7 +107,10 @@ class TranslationWriter
             }
         }
 
-        return json_encode($cleanedTranslations, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
+        /*
+         * ToDo: Use JSON_UNESCAPED_UNICODE and JSON_PRETTY_PRINT for PHP >= 5.4
+         */
+        return json_encode($cleanedTranslations);
     }
 
     /**
diff --git a/tests/PHPUnit/Core/TranslationWriterTest.php b/tests/PHPUnit/Core/TranslationWriterTest.php
index 7a1dd2b014..cb1d458aec 100644
--- a/tests/PHPUnit/Core/TranslationWriterTest.php
+++ b/tests/PHPUnit/Core/TranslationWriterTest.php
@@ -179,17 +179,7 @@ class TranslationWriterTest extends PHPUnit_Framework_TestCase
         $this->assertNotEquals(false, $rc);
 
         $contents = file_get_contents($path);
-        $expected = <<<'EOD'
-{
-    "General": {
-        "Locale": "en_CA.UTF-8",
-        "Id": "Id"
-    },
-    "Goals": {
-        "Goals": "Goals"
-    }
-}
-EOD;
+        $expected = '{"General":{"Locale":"en_CA.UTF-8","Id":"Id"},"Goals":{"Goals":"Goals"},"Plugin":{"Body":"Message\nBody"}}';
 
         if (Common::isWindows()) $expected = str_replace("\r\n", "\n", $expected);
         $this->assertEquals($expected, $contents);
-- 
GitLab