]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6314 from MrPetovan/task/6208-escape-html-true
authorMichael Vogel <icarus@dabo.de>
Mon, 24 Dec 2018 07:40:30 +0000 (08:40 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Dec 2018 07:40:30 +0000 (08:40 +0100)
 Fix template escaping in photo gallery view

src/Core/Installer.php
tests/src/Core/InstallerTest.php

index b84bcd916efc4574c2effbd767890cf0deaf901b..74d6114f160e124644555c5d8a3027ad8dbc44f4 100644 (file)
@@ -440,6 +440,13 @@ class Installer
                );
                $returnVal = $returnVal ? $status : false;
 
+               $status = $this->checkFunction('json_encode',
+                       L10n::t('JSON PHP module'),
+                       L10n::t('Error: JSON PHP module required but not installed.'),
+                       true
+               );
+               $returnVal = $returnVal ? $status : false;
+
                return $returnVal;
        }
 
index 32a80a77e0988adc3ef3283d3d22c776a7f61802..3d7effe52b0dc26d5952353fd172bdd695564dfb 100644 (file)
@@ -43,6 +43,8 @@ class InstallerTest extends MockedTest
                $this->mockL10nT('Error: iconv PHP module required but not installed.', 1);
                $this->mockL10nT('POSIX PHP module', 1);
                $this->mockL10nT('Error: POSIX PHP module required but not installed.', 1);
+               $this->mockL10nT('JSON PHP module', 1);
+               $this->mockL10nT('Error: JSON PHP module required but not installed.', 1);
        }
 
        private function assertCheckExist($position, $title, $help, $status, $required, $assertionArray)
@@ -177,6 +179,17 @@ class InstallerTest extends MockedTest
                        true,
                        $install->getChecks());
 
+               $this->mockFunctionL10TCalls();
+               $this->setFunctions(['json_encode' => false]);
+               $install = new Installer();
+               $this->assertFalse($install->checkFunctions());
+               $this->assertCheckExist(9,
+                       'JSON PHP module',
+                       'Error: JSON PHP module required but not installed.',
+                       false,
+                       true,
+                       $install->getChecks());
+
                $this->mockFunctionL10TCalls();
                $this->setFunctions([
                        'curl_init' => true,
@@ -184,7 +197,8 @@ class InstallerTest extends MockedTest
                        'openssl_public_encrypt' => true,
                        'mb_strlen' => true,
                        'iconv_strlen' => true,
-                       'posix_kill' => true
+                       'posix_kill' => true,
+                       'json_encode' => true
                ]);
                $install = new Installer();
                $this->assertTrue($install->checkFunctions());