]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove the magic parsing of the description
authorJoas Schilling <coding@schilljs.com>
Fri, 30 Sep 2016 12:41:37 +0000 (14:41 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 17 Jan 2017 10:36:32 +0000 (11:36 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/legacy/app.php

index 8ef7e08c733a14b196094fd7341279488feba5e9..a989ba940011a60f8ea7ef944f7dd8824665a9e3 100644 (file)
@@ -1307,30 +1307,8 @@ class OC_App {
                        $data['description'] = self::findBestL10NOption($data['description'], $lang);
                }
 
-               // just modify the description if it is available
-               // otherwise this will create a $data element with an empty 'description'
-               if (isset($data['description'])) {
-                       if (is_string($data['description'])) {
-                               // 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
-                               // manages line breaks itself
-
-                               // first of all we split on empty lines
-                               $paragraphs = preg_split("!\n[[:space:]]*\n!mu", $data['description']);
-
-                               $result = [];
-                               foreach ($paragraphs as $value) {
-                                       // replace multiple whitespace (tabs, space, newlines) inside a paragraph
-                                       // with a single space - also trims whitespace
-                                       $result[] = trim(preg_replace('![[:space:]]+!mu', ' ', $value));
-                               }
-
-                               // join the single paragraphs with a empty line in between
-                               $data['description'] = implode("\n\n", $result);
-
-                       } else {
-                               $data['description'] = '';
-                       }
+               if (!isset($data['description'])) {
+                       $data['description'] = '';
                }
 
                return $data;