From 9b6f98d2c826c61b7fe5dcbb91102ef3fdb06211 Mon Sep 17 00:00:00 2001 From: esensar Date: Tue, 31 May 2016 23:41:25 +0200 Subject: [PATCH] Fix new lines in news --- gori.php | 1 + index.php | 1 + 2 files changed, 2 insertions(+) diff --git a/gori.php b/gori.php index adca5e9..a7bb671 100644 --- a/gori.php +++ b/gori.php @@ -15,6 +15,7 @@ if(isset($_POST['vijest'])) { $vijestiFile = file_get_contents($openShiftFolder."vijesti.csv"); $vijest = $_POST['vijest']; + $vijest = str_replace("\n", "
", $vijest); if(strpos($vijest, ',') !== FALSE) { $vijest = str_replace('"', '""', $vijest); $vijest = '"'.$vijest.'"'; diff --git a/index.php b/index.php index 977e1d5..0a110e9 100644 --- a/index.php +++ b/index.php @@ -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];