Fix new lines in news

master
esensar 2016-05-31 23:41:25 +02:00
parent 2c31a3fa6a
commit 9b6f98d2c8
2 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@
if(isset($_POST['vijest'])) {
$vijestiFile = file_get_contents($openShiftFolder."vijesti.csv");
$vijest = $_POST['vijest'];
$vijest = str_replace("\n", "<br />", $vijest);
if(strpos($vijest, ',') !== FALSE) {
$vijest = str_replace('"', '""', $vijest);
$vijest = '"'.$vijest.'"';

View File

@ -10,6 +10,7 @@
$counter = 0;
foreach ($newsFile as $news) {
$nesto = str_getcsv($news);
if($nesto.length < 3) continue;
$timesArray[$counter] = $nesto[0];
$imagesArray[$counter] = $nesto[1];
$newsArray[$counter] = $nesto[2];