MyBB Community Forums

Full Version: [F] Empty postings in 1.4.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

after I updated 1.4.3 to 1.4.4 all postings were empty. Huh

By adding debug messages, I found that the message parser returns an empty string for me now after parsing the message. There are two culprits.

One is my_wordwrap(), it works fine with values > 0, but when I set wordwrap to 0 it retuns an empty message, not sure why.

The other is the smiley parser, in class_parser.php, this line makes message an empty string:

$message = preg_replace("#(?<=[^\"])".$find."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining);

As for the reason, I have no idea yet.

If no one else is experiencing the issues, it may be a compatibility problem. My server is still running PHP 4.3.10.
I can reproduce the empty posting issue with wordwrap = 0 on a PHP5 server. I guess that's partly my fault, as wordwrapper was changed due to a bugreport of mine, and I guess I only tested it with wordwrap values > 0.

The smiley parser works fine on PHP5 but for some reason that one preg_replace call causes issues on PHP4.
my_wordwrap returns $new_message which only gets set with wordwrap > 0. Easy to fix.

The preg_replace is more complicated, I don't know enough about PHP / preg_replace to know what is different that makes it work in PHP5 but not in PHP4.
Fixed the my_wordwrap issue. Update your inc/functions.php with a fresh one
I still have the same problem :/

Already downloaded the new functions.php file and uploaded to my site and I still can't see any posts
Like I said it only fixes the my_wordwrap issue.
So you're still trying to fix the other problem?

Edit:
I think the problem is in $cache->parse_message() at least the shotubox on my forum uses that function to parse the messages and the message does not get displayed also.
I am going to try to find what's the problem.

Edit
yes it is the problem for sure.
I commented everything inside the function except the return and it works.
Now, it's time to find what's wrong inside the function

Edit:

		if($options['allow_smilies'])

		{

			$message = $this->parse_smilies($message, $options['allow_html']);

		}
is the part of the function that makes everything to not work

So the function parse_smilies() is what's causing the problem
Okay this is the problem:
$message = preg_replace("#(?<=[^\"])".$find."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining);

Line 415.

Replace it with:
$message = preg_replace("#(?<=[^&;\"])".$find."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining);

Notice the &;\ instead of only \"