Hey y'all, maybe someone else has an idea of whats going on, because i kinda don't anymore.

I added a line with preg_replace to the stripQuotedReply function in class.thread.php in line 2741. The lines in question look like this now:
function stripQuotedReply($tag) {
$this->body = preg_replace('/Mit freundlichen Grüßen.*?muss\.\n*/s', '', $this->body);
//Strip quoted reply...on emailed messages
if (!$tag || strpos($this->body, $tag) === false)
return;

The line basically replaces the signature that gets added automatically in our enviroment with an empty string. It does so by matching the first few words of the signature, followed by basically anything, and then the last word of the signature. And that works absolutely fine without a problem. However once i add the global flag and turns /s into /gs, all the tickets that get created via mail are empty.
I originally stumbled upon this, because i wanted to be able to forward mails that users send to us instead of the ticket system to the ticket system itself, and for that i'd need to remove both the users and my signature, so i wanted to use a positive lookahead, skip the actual text from the message i wanna forward, and then match the second signature, but whatever i did, i only got empty tickets. I tested my regex with https://gchq.github.io/CyberChef/ and https://regexr.com/, so i'm fairly certain that is right. Is there maybe something about the preg_replace function that i'm missing?

osTicket Version: 1.15.6
PHP: 7.4.21

Write a Reply...