aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArno Richter <mail@arnorichter.de>2022-01-27 11:59:21 +0100
committerGitHub <noreply@github.com>2022-01-27 11:59:21 +0100
commitcfacbe9804833824490518076330de865f99c032 (patch)
tree76b7a843b486d65b6c248389331eff337244f84a
parent4439384291ef7d7da07fce7ddd4bab4a7879f96e (diff)
parent594ba3c4c945557182ac946d6c293cb388620dfe (diff)
downloadmicroblog-cfacbe9804833824490518076330de865f99c032.tar.gz
microblog-cfacbe9804833824490518076330de865f99c032.tar.bz2
microblog-cfacbe9804833824490518076330de865f99c032.zip
Merge pull request #11 from jaquer/nl2br
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>