Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 10-16-2007, 06:49 PM
Idealist Idealist is offline
 
Join Date: May 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 10-17-2007, 05:59 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please enable Public PHPInfo in your vBuletin Options and provide a link to your board.
Reply With Quote
  #3  
Old 10-17-2007, 02:13 PM
Idealist Idealist is offline
 
Join Date: May 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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.
Reply With Quote
  #4  
Old 10-17-2007, 05:11 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try increasing the 'post_max_size' in your PHP config. Other then that, i don't see anything obvious.
Reply With Quote
  #5  
Old 10-17-2007, 05:15 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

25,000 chars is rather a lot, I would have though that limiting posts to (a lot) less than that would be sensible anyway.
Reply With Quote
  #6  
Old 10-17-2007, 07:04 PM
Idealist Idealist is offline
 
Join Date: May 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 10-18-2007, 05:35 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice find, how did you find this if it was not logged?
Reply With Quote
  #8  
Old 10-18-2007, 10:24 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 10-18-2007, 02:51 PM
Idealist Idealist is offline
 
Join Date: May 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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 View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:48 AM.


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.06896 seconds
  • Memory Usage 2,230KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete