aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaquer <jaquer@users.noreply.github.com>2022-01-26 16:16:55 -0800
committerjaquer <jaquer@users.noreply.github.com>2022-01-26 16:16:55 -0800
commit594ba3c4c945557182ac946d6c293cb388620dfe (patch)
treeef3d4a85b9b0189dead52fd593289130fcb15396
parent5922ced6820ea7349f627c9de83859c3fa340a4c (diff)
downloadmicroblog-594ba3c4c945557182ac946d6c293cb388620dfe.tar.gz
microblog-594ba3c4c945557182ac946d6c293cb388620dfe.tar.bz2
microblog-594ba3c4c945557182ac946d6c293cb388620dfe.zip
Call nl2br() when showing post content to maintain line breaks.
-rw-r--r--single.inc.php2
-rw-r--r--timeline.inc.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/single.inc.php b/single.inc.php
index 7ef7251..623e121 100644
--- a/single.inc.php
+++ b/single.inc.php
@@ -26,7 +26,7 @@
$formatted_time = strftime('%b %d %Y %H:%M', $post['post_timestamp']);
?>
<time class="post-timestamp" datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time>
- <p class="post-message"><?= autolink($post['post_content']) ?></p>
+ <p class="post-message"><?= nl2br(autolink($post['post_content'])) ?></p>
<?php else: ?>
<p>No post with this ID.</p>
<?php endif; ?>
diff --git a/timeline.inc.php b/timeline.inc.php
index 13a4d54..f560d24 100644
--- a/timeline.inc.php
+++ b/timeline.inc.php
@@ -42,7 +42,7 @@
$formatted_time = strftime('%b %d %Y %H:%M', $post['post_timestamp']);
?>
<a class="post-timestamp" href="<?= $config['url'] ?>/<?= $post['id'] ?>"><time datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time></a>
- <p class="post-message"><?= autolink($post['post_content']) ?></p>
+ <p class="post-message"><?= nl2br(autolink($post['post_content'])) ?></p>
</li>
<?php endforeach; ?>
</ul>