diff options
author | msquare <msquare@notrademark.de> | 2017-12-26 10:29:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-26 10:29:16 +0100 |
commit | de61c88d6de67d12d5de5b6dd0ab6b8c82e5a290 (patch) | |
tree | aac6a43cb88e3d803da5809ab37885b41bc811c6 /includes/pages/user_news.php | |
parent | 879918864a9c6da0fe9be1aca6c443ec8df0afc3 (diff) | |
parent | f8d0a7c5b00a58c646871e355b5876dcc5890be5 (diff) |
Merge pull request #388 from MyIgel/master
Formatting, Docstrings, and fixup
Diffstat (limited to 'includes/pages/user_news.php')
-rw-r--r-- | includes/pages/user_news.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index ba5ed53e..0ec93627 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -73,11 +73,12 @@ function user_meetings() /** * Renders the text content of a news entry - * + * * @param array $news * @return string HTML */ -function news_text($news) { +function news_text($news) +{ $text = ReplaceSmilies($news['Text']); $text = preg_replace("/\r\n\r\n/m", '<br><br>', $text); return $text; @@ -101,7 +102,11 @@ function display_news($news) $html .= '<div class="panel-footer text-muted">'; if (in_array('admin_news', $privileges)) { $html .= '<div class="pull-right">' - . button_glyph(page_link_to('admin_news', ['action' => 'edit', 'id' => $news['ID']]), 'edit', 'btn-xs') + . button_glyph( + page_link_to('admin_news', ['action' => 'edit', 'id' => $news['ID']]), + 'edit', + 'btn-xs' + ) . '</div>'; } $html .= '<span class="glyphicon glyphicon-time"></span> ' . date('Y-m-d H:i', $news['Datum']) . ' '; @@ -140,7 +145,11 @@ function user_news_comments() $nid = $request->input('nid'); $news = DB::selectOne('SELECT * FROM `News` WHERE `ID`=? LIMIT 1', [$nid]); if ($request->has('text')) { - $text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($request->input('text'))); + $text = preg_replace( + "/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", + '', + strip_tags($request->input('text')) + ); DB::insert(' INSERT INTO `NewsComments` (`Refid`, `Datum`, `Text`, `UID`) VALUES (?, ?, ?, ?) |