From d2e1ff339323b558d87bff7cf9da557152600797 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Wed, 7 Apr 2021 16:44:17 -0600 Subject: Replace newlines with HTML breaks --- model/Post.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model/Post.php b/model/Post.php index 02c9dec..91cd3be 100644 --- a/model/Post.php +++ b/model/Post.php @@ -68,6 +68,9 @@ class Post { return add_quote($dbc, $thread_id, $matches); }, $post_content); + // Replace newline characters with HTML
tags + $post_content = nl2br($post_content); + // Replace YouTube URLs with embedded YouTube videos. $post_content = preg_replace( "/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", -- cgit v1.2.3