aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-07-01 01:44:33 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-01 07:52:40 +0200
commit09038697cd57a98d4b15c7527050fd3cb45aba2e (patch)
tree9cf8ea01559b60ff634eabde8d3546e139397e65 /lib/private
parent16ff6cff54768c15f126e523d195a6993e0e2aea (diff)
downloadnextcloud-server-09038697cd57a98d4b15c7527050fd3cb45aba2e.tar.gz
nextcloud-server-09038697cd57a98d4b15c7527050fd3cb45aba2e.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 'lib/private')
-rw-r--r--lib/private/app.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index c506be1799b..1a32fcfcf77 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -1228,17 +1228,18 @@ class OC_App {
// manages line breaks itself
// first of all we split on empty lines
- $paragraphs = preg_split("!\n[[:space:]]*\n!m", $data['description']);
+ $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:]]+!m', ' ', $value));
+ $result[] = trim(preg_replace('![[:space:]]+!mu', ' ', $value));
}
// join the single paragraphs with a empty line in between
$data['description'] = implode("\n\n", $result);
+
}
return $data;