From 94cab9f4333bb7e45480e713dc8457bbf5380fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Wed, 10 Jun 2020 00:33:11 +0200 Subject: [PATCH] MAPG-41 fix line ending replace --- src/Controller/MapAdminController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/MapAdminController.php b/src/Controller/MapAdminController.php index 0019469..2a240d4 100644 --- a/src/Controller/MapAdminController.php +++ b/src/Controller/MapAdminController.php @@ -45,7 +45,7 @@ class MapAdminController implements ISecured $bounds = Bounds::createDirectly($map['bound_south_lat'], $map['bound_west_lng'], $map['bound_north_lat'], $map['bound_east_lng']); $places = $this->getPlaces($mapId); - $data = ['mapId' => $mapId, 'mapName' => $map['name'], 'mapDescription' => str_replace('
', '\n', $map['description']), 'bounds' => $bounds->toArray(), 'places' => &$places]; + $data = ['mapId' => $mapId, 'mapName' => $map['name'], 'mapDescription' => str_replace('
', "\n", $map['description']), 'bounds' => $bounds->toArray(), 'places' => &$places]; return new HtmlContent('admin/map_editor', $data); } @@ -110,7 +110,7 @@ class MapAdminController implements ISecured $map['name'] = $_POST['name'] ? $_POST['name'] : '[unnamed map]'; } if (isset($_POST['description'])) { - $map['description'] = str_replace(['\n', '\r\n'], '
', $_POST['description']); + $map['description'] = str_replace(["\n", "\r\n"], '
', $_POST['description']); } $this->saveMapData($mapId, $map);