diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-07-01 01:44:33 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-07-01 16:51:45 +0200 |
commit | 7ec91b91775ca1419f7901a3edc399b06fe41b63 (patch) | |
tree | bfa63e682a506d6b595a03eb47972d64196eb71a /lib/private | |
parent | f8e6800cd4a7350d73ce5a70b008d66b57ac3bd5 (diff) | |
download | nextcloud-server-7ec91b91775ca1419f7901a3edc399b06fe41b63.tar.gz nextcloud-server-7ec91b91775ca1419f7901a3edc399b06fe41b63.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.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index 1ebad2db770..6c38cdb8223 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -1227,17 +1227,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; |