This is the code in question
// Now, on to bonuses.
// Strip out all BBCode
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $_POST['message']);
// Convert all newlines into spaces
$plaintext = str_replace(array('<br />', "\r", "\n"), ' ', $plaintext);
// Convert multiple successive spaces into a single space
$plaintext = preg_replace('/\s+/', ' ', $plaintext);
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));
As you can see, it has no way of knowing what is in quotes and what is not. The only way to do that would be for it to search for [quote] tags before it strips the bbc code. Remove everything between [quote] tags. And go from there. My string magic is rusty. But I think it would look something like
$plaintext = preg_replace('[QUOTE](.*?)[/QUOTE]', ' ', $_POST['message']);
You would then want
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $plaintext);
instead of
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $_POST['message']);
But you really should learn how those string magical commands work. Because I think mine is wrong. Basically, you want to find the string "[quote]", and then contain everything that lies between it and the string [/quote]. Right now, that thing finds "[" and nukes everything between it an "]". So you need to kill the quotes before you kill the BBCode.
Regardless. I hope this helps. Sorry I donno string magic(which is totally the wrong term) any better.
Edited by Daniel15: Fixed formatting