Post Reply  Post Thread 
[HELP] MyBB SEO displaying white pages to some people!
Icy
Junior Member
**

Posts: 3
Group: Registered
Joined: Oct 2008
Status: Offline
Reputation: 0
Post: #1
[HELP] MyBB SEO displaying white pages to some people!

Hi, I've been using MyBB SEO 2 days ago, and some guests/users see a white page with MyBB SEO plugin installed. I tryed to deactivate it, and now people that saw a white page, can now browse my forums perfectly.

I'm currently using MyBB 1.4.4, and if you want to check the board for something.. here you go: http://planeta-playstation.com/forum/

Thank you.

01-01-2009 12:30 PM
Find all posts by this user Quote this message in a reply
avalanch
Junior Member
**

Posts: 22
Group: Registered
Joined: May 2008
Status: Offline
Reputation: 0
Post: #2
RE: [HELP] MyBB SEO displaying white pages to some people!

http://vgchat.info
http://codeshq.site88.net
01-01-2009 10:21 PM
Find all posts by this user Quote this message in a reply
pozmu
Junior Member
**

Posts: 3
Group: Registered
Joined: Apr 2008
Status: Offline
Reputation: 0
Post: #3
RE: [HELP] MyBB SEO displaying white pages to some people!

I have similar problem, I have an announcement that is visible when you are logged in, but when you log-out the page with that announcement is completely blank (disabling the plugin fixes it)

Update: ok, I disabled Add nofollow? and it works, but there is something broken anyway... I would like use nofollow too :/

Update 2: Ok, I found source of the error... It's pcre.backtrack_limit setting - the actual error is PREG_BACKTRACK_LIMIT_ERROR.... In PHP 5.2.x they changed this value from pcre default to something like 100k... Which is too little.... Despite that, the way that mybb seo add "nofollow" to links isn't very good... don't get me wrong - I don't know if there is better way, it may be plugins system limitation, but now it scans whole page looking for links, including the post itself.... but maybe it should be done that way?
FIX
To fix this problem, you have to specify new value for pcre.backtrack_limit. You can do this in php.ini if you have access to it (just search for such string, uncomment it and change value) or you can do it directly in the script using ini_set function: go to line 471 of seo.php (inc/plugins directory) and add after {

PHP Code:
ini_set("pcre.backtrack_limit",10000000); 

I think 10000000 is default pcre value (as in previous php versions).
You can also add error message that will inform you if this backtracking error occurs again (fingers crossed): just add this at the end of line 472

PHP Code:
if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) {
    print 
'preg backtracking limit error!';

To sum it up: it should look something like this: (starting from line 470):

PHP Code:
    if ($mybb->user['usergroup'] == && NOFOLLOW_UNF_LINKS == 1)
    { 
ini_set("pcre.backtrack_limit",10000000);
        
$page preg_replace("#(<a.+?href=.+?(search|stats|usercp2|printthread|sendthread|showteam|memberlist|calendar|memb er|online|private|newreply|newthread|showthread|forumdisplay)\.php)(.+?)>(.+?)</a>#e""seo_add_nofollow('\\1', '\\3', '\\4')"$page); if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) {
    print 
'preg backtracking limit error!';
}
    } 

10-30-2009 04:23 PM

This post was last modified: 10-31-2009 01:18 AM by pozmu.

Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: