News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

The message body was left empty.

Started by Kolya, December 02, 2006, 11:24:47 PM

Previous topic - Next topic

Kolya

After upgrading from 1.1 RC3 to 1.1 whenever someone tries to post they get the error:

"The message body was left empty."

That is of course not the case. So any help would be appreciated.
I checked this with the SMF default theme.

Kolya

Related forum error:

2: Compilation failed: invalid escape sequence in character class at offset 30
File: /www/htdocs/kolya/Sources/Subs-Post.php
Line: 208

Kolya

#2
Commenting out this part of Sources/Subs-Post.php allows me to post again:

   
        if (strpos($user_info['name'], '[') !== false | strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false)
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me="' . $user_info['name'] . '"]$1[/me]', $parts[$i]);
else
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);|


I still hope someone can come up with a better fix.

Kolya

Or at least tell me what hideous security problems this generates. Come on.

Kret

hi, did you fixed that any chance?
i have exactly same problem

Soap on a Rope

#5
I, too, have this problem. Also, when I tried to post news to the newsbox, the whole box went blank after I saved.

And Kolya's suggestion did indeed fix this (and the newsbox posting). I suppose this will work until there is an official fix - not like /me gets used all that much anyway.

SleePy

This doesn't look like it creates a security problem. commenting it out will have little effect on your forums
The only thing that wont work now is you can't use /me while making a post and must use [me][/me] to post..

But Try this line of code. I saw some php errors in that and this should fix it...

if (strpos($user_info['name'], '[') !== false || strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false)
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me="' . $user_info['name'] . '"]$1[/me]', $parts[$i]);
else
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

cheloman

I have the same problem and Im awaiting for an official reply about this.

Kolya

#8
Just tested SleePy's code but it produced the same bug for me. So commenting the code out is the only solution so far.

Kret: Open Sources/Subs-Post.php in windows editor. Search for the code I mentioned above and put it between
/* and */

Compuart

Try the following for the given lines:
Code (Subs-Post.php) Select
if (strpos($user_info['name'], '[') !== false || strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false)
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '[me="' . $user_info['name'] . '"]$1[/me]', $parts[$i]);
else
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n]*)(?:\z)?~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

cheloman


Kret

worked for me as well
thanx for tip Kolya

lats hope all will be fix that in next update.

SleePy

I don't think it was an error at all. I think your files uploaded incorrectly..
I don't see that in my local copies of 1.1 Final at all..
and btw.. Compuart gave you the same thing as I did :P
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Kolya

#13
Thanks Compuart, worked for me too.  :)

SleePy, it's not the same. Have another look.

SleePy

lol your right. Its slightly different.. I just took mine from what he posted.. I just fixed 1 character because some reason the | got moved to the end of that instead of being with the other single | in the if check.. that is all that needed done and should of fixed it..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

SkyWarp

I had this same problem and comp's code fixed it.  Thanks. 

jsdoyle

I also had this problem.  The fix posted worked for me.  Can you say "Patch"?  Easy enough to fix but I'd be updating the download on the site ASAP.

I'm surprised that the final 1.1 had such a bug in it.  But good god that's a lot of code.  I appreciate the work of the SMF staff!  Thanks!

Scott

Chrisprice999

I too had the same problem,
Thank you to all of you that contributed to fixing this bug.
regards
Chris

Elisor

Ditto, had the same problem.  Compuart's code fixed it :)

Random

Same problem here too, but again, that code fixed it  :)

Advertisement: