summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
453dc46)
Move duplicate code from issue and reply pages.
- $html = nl2br(htmlspecialchars($_POST['body']));
- $html = empty($html) ? NULL : "<p>$html</p>";
+ require_once 'upload.inc.php';
$query = $Db->set('issues', [
'page' => $Page,
'subject' => $_POST['subject'],
$query = $Db->set('issues', [
'page' => $Page,
'subject' => $_POST['subject'],
+ 'body' => messagehtml($_POST['body']),
'author' => $User->login,
]);
if (!$query->rowCount()) {
'author' => $User->login,
]);
if (!$query->rowCount()) {
+
+function messagehtml($input)
+{
+ # convert user textarea post to formatted html
+ if (empty($input)) {
+ return;
+ }
+ $html = htmlspecialchars($input);
+ $html = nl2br($html);
+ return "<p>$html</p>";
+}
+ require_once 'upload.inc.php';
- $html = nl2br(htmlspecialchars($_POST['reply']));
- $html = empty($html) ? NULL : "<p>$html</p>";
$query = $Db->set('comments', [
'page' => $Page,
$query = $Db->set('comments', [
'page' => $Page,
+ 'message' => messagehtml($_POST['reply']),
'author' => $User->login,
]);
if (!$query->rowCount()) {
'author' => $User->login,
]);
if (!$query->rowCount()) {