summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2021-10-19 19:40:39 -0400
committerMalfurious <m@lfurio.us>2021-10-19 19:40:39 -0400
commit11c71fb05a3115f470230de9a5fb88fac1385010 (patch)
tree3c12dff9fc9a025321d8b9898df2eec796f1d101
parent2b5ea48b854e4441cc89666d5c1d5fb30f8453ea (diff)
downloadscrott-11c71fb05a3115f470230de9a5fb88fac1385010.tar.gz
scrott-11c71fb05a3115f470230de9a5fb88fac1385010.zip
Enable greentext in issue messages
Signed-off-by: Malfurious <m@lfurio.us>
-rw-r--r--app/class/mesg.class.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/class/mesg.class.php b/app/class/mesg.class.php
index 365431c..2104519 100644
--- a/app/class/mesg.class.php
+++ b/app/class/mesg.class.php
@@ -221,11 +221,16 @@ class mesg extends obj
public function renderMesg() : string
{
if ($this->objtype == "log")
+ {
$mesg = sprintf($this->mesg, $this->getAuthor()->getDisplayName());
+ }
else
- $mesg = $this->mesg;
+ {
+ $mesg = nl2br(str_replace(" ", "&nbsp;", $this->mesg));
+ $mesg = preg_replace('/^(\s*&gt;.*)$/m', '<span class="text-success">${1}</span>', $mesg);
+ }
- return nl2br(str_replace(" ", "&nbsp;", $mesg));
+ return $mesg;
}
/*