Only do the description kung-fu on strings - fixes #17028
This commit is contained in:
parent
5caeda33f1
commit
aae55174f6
|
@ -1223,6 +1223,7 @@ class OC_App {
|
||||||
// just modify the description if it is available
|
// just modify the description if it is available
|
||||||
// otherwise this will create a $data element with an empty 'description'
|
// otherwise this will create a $data element with an empty 'description'
|
||||||
if (isset($data['description'])) {
|
if (isset($data['description'])) {
|
||||||
|
if (is_string($data['description'])) {
|
||||||
// sometimes the description contains line breaks and they are then also
|
// sometimes the description contains line breaks and they are then also
|
||||||
// shown in this way in the app management which isn't wanted as HTML
|
// shown in this way in the app management which isn't wanted as HTML
|
||||||
// manages line breaks itself
|
// manages line breaks itself
|
||||||
|
@ -1240,6 +1241,9 @@ class OC_App {
|
||||||
// join the single paragraphs with a empty line in between
|
// join the single paragraphs with a empty line in between
|
||||||
$data['description'] = implode("\n\n", $result);
|
$data['description'] = implode("\n\n", $result);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$data['description'] = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
|
@ -510,6 +510,10 @@ class Test_App extends \Test\TestCase {
|
||||||
['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 "],
|
||||||
['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 "]
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
['description' => [100, 'bla']],
|
||||||
|
['description' => ""]
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue