summaryrefslogtreecommitdiffstats
path: root/tests/lib/app.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-07-01 01:44:33 +0200
committerLukas Reschke <lukas@owncloud.com>2015-07-01 01:44:33 +0200
commitaff55347f96e1cf990a4871bc69dafaaebf490f6 (patch)
tree9cf8ea01559b60ff634eabde8d3546e139397e65 /tests/lib/app.php
parent16ff6cff54768c15f126e523d195a6993e0e2aea (diff)
downloadnextcloud-server-aff55347f96e1cf990a4871bc69dafaaebf490f6.tar.gz
nextcloud-server-aff55347f96e1cf990a4871bc69dafaaebf490f6.zip
Use UTF-8 mode for preg_split and preg_replace
Otherwise a single application with a description containing a non compliant character can break the whole ownCloud appstore. This is for example https://apps.owncloud.com/content/show.php?content=149553 Fixes https://github.com/owncloud/core/issues/17101#issuecomment-117365224
Diffstat (limited to 'tests/lib/app.php')
-rw-r--r--tests/lib/app.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/lib/app.php b/tests/lib/app.php
index 3f380f74fd2..9724c6e2344 100644
--- a/tests/lib/app.php
+++ b/tests/lib/app.php
@@ -503,6 +503,10 @@ class Test_App extends \Test\TestCase {
['description' => "This is a multiline test with some new lines"]
],
[
+ ['description' => hex2bin('5065726d657420646520732761757468656e7469666965722064616e732070697769676f20646972656374656d656e74206176656320736573206964656e74696669616e7473206f776e636c6f75642073616e73206c65732072657461706572206574206d657420c3a0206a6f757273206365757820636920656e20636173206465206368616e67656d656e74206465206d6f742064652070617373652e0d0a0d')],
+ ['description' => "Permet de s'authentifier dans piwigo directement avec ses identifiants owncloud sans les retaper et met à jours ceux ci en cas de changement de mot de passe."]
+ ],
+ [
['not-a-description' => " \t This is a multiline \n test with \n \t some new lines "],
['not-a-description' => " \t This is a multiline \n test with \n \t some new lines "]
],
@@ -513,9 +517,11 @@ class Test_App extends \Test\TestCase {
* Test app info parser
*
* @dataProvider appDataProvider
+ * @param array $data
+ * @param array $expected
*/
- public function testParseAppInfo($data, $expected) {
- $this->assertEquals($expected, \OC_App::parseAppInfo($data));
+ public function testParseAppInfo(array $data, array $expected) {
+ $this->assertSame($expected, \OC_App::parseAppInfo($data));
}
}