MAPG-41 fix line ending replace

This commit is contained in:
Bence Pőcze 2020-06-10 00:33:11 +02:00
parent 4b0057e3ba
commit 94cab9f433

View File

@ -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('<br>', '\n', $map['description']), 'bounds' => $bounds->toArray(), 'places' => &$places];
$data = ['mapId' => $mapId, 'mapName' => $map['name'], 'mapDescription' => str_replace('<br>', "\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'], '<br>', $_POST['description']);
$map['description'] = str_replace(["\n", "\r\n"], '<br>', $_POST['description']);
}
$this->saveMapData($mapId, $map);