vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Post character limit(24998) after switch to PHP5 (https://vborg.vbsupport.ru/showthread.php?t=160389)

Idealist 10-16-2007 06:49 PM

Post character limit(24998) after switch to PHP5
 
Ever since switching from PHP 4 to 5 new posts and edits that aren't done via quick edit end up blank if they're more than 24998 characters. I've had to place a limit on post size via the "Maximum Characters Per Post" setting, so users won't lose edits or new posts.

Here's a bit of info about the forum/server:
CENTOS Enterprise 4.4 i686
Apache 1.3.39
PHP 5.2.4
MySQL 4.0.27
vB 3.5.4 with security patches

There've been no errors reported by PHP or in the server's error_log. I've tried on a test instance of vB without any plugins and the same happens. Any ideas?

Marco van Herwaarden 10-17-2007 05:59 AM

Please enable Public PHPInfo in your vBuletin Options and provide a link to your board.

Idealist 10-17-2007 02:13 PM

<a href="http://sleepywood.net/forum/" target="_blank">http://sleepywood.net/forum/</a>

You'll see APC enabled, but the test forum had it disabled and still had the problem.

Marco van Herwaarden 10-17-2007 05:11 PM

Try increasing the 'post_max_size' in your PHP config. Other then that, i don't see anything obvious.

Paul M 10-17-2007 05:15 PM

25,000 chars is rather a lot, I would have though that limiting posts to (a lot) less than that would be sensible anyway.

Idealist 10-17-2007 07:04 PM

PHP would've logged an error if it exceeded post_max_size.

I thought 20k was enough after I noticed the blanking, but then the users got antsy about it. Think I'll look at what handles the quick edits compared to normal edits and see if I can fix this myself.

I'll post about it on success.

--------------- Added [DATE]1192684620[/DATE] at [TIME]1192684620[/TIME] ---------------

Found it! It failed at:

PHP Code:

function strip_empty_bbcode($text)
{
    return 
preg_replace('#(^.*|.*)(\[(php|html|noparse)\].*\[/\\3])(.*|.*$)#siUe'"\$this->strip_empty_bbcode_callback('\\1', '\\2', '\\4')"$text);


strip_empty_bbcode ended up causing the script to hit the pcre.backtrack_limit and/or pcre.recursion_limit settings yet not logging an error.

I suggest having the option to set these in the vB AdminCP, or just correlate the setting to the "Maximum Characters Per Post" setting. The quickest solution is an:
PHP Code:

ini_set('pcre.backtrack_limit''-1');
ini_set('pcre.recursion_limit''-1'); 

At the top of class_dm.php.

Marco van Herwaarden 10-18-2007 05:35 AM

Very nice find, how did you find this if it was not logged?

Marco van Herwaarden 10-18-2007 10:24 AM

I had a short chat with one of our developers on this subject, and it is known that this can happen in PHP 5.2, and a workaround has been added since 3.5.8 & 3.6.5.

My advice is to upgrade to a newer vBulletin version.

Idealist 10-18-2007 02:51 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1362869)
Very nice find, how did you find this if it was not logged?

error_log()'ing at each point the message was changed. Took a moderate amount of time, I hoped it'd be quicker and dreaded it'd being longer.

Quote:

Originally Posted by Marco van Herwaarden (Post 1362964)
I had a short chat with one of our developers on this subject, and it is known that this can happen in PHP 5.2, and a workaround has been added since 3.5.8 & 3.6.5.

My advice is to upgrade to a newer vBulletin version.

My forum is very customized, the work I did finding this is less than checking each bit of customization. But a fine suggestion for others with this problem that don't want to screw with php.ini settings.


All times are GMT. The time now is 07:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01015 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete