Log in

View Full Version : Search was timing out


DragonBlade
06-11-2009, 12:16 AM
Hey, peoples,

My members were experiencing a problem where a blank white page was returned when Searching for a post, and this was in the Apache error log:
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /[mypath]/includes/functions.php on line 1822, referer: http://[myforums]/search.php

Looking on that line, it's a regular expression used in the strip_bbcode() function.

This post (http://www.vbulletin.com/forum/project.php?issueid=5482) from several years ago is what I followed to "fix" the problem, but I think that it didn't really "fix" anything--it just made it so the regex doesn't match anything so it doesn't go through that loop to change anything. XP

I don't think that raising my max execution time would help matters much, and I really don't want to have to do that anyways. Could someone shed some light on this for me?

The original line in the file was:while(preg_match_all('#\[(\w+?)(?>[^\]]*?)\](.*)(\[/\1\])#siU', $message, $regs))I just changed it to:while(preg_match_all('#\[(\w+?)(?>[^\]]*)\](.*)(\[/\1\])#siU', $message, $regs))as was shown in that post I referenced. So I'm guessing, maybe it has something to do with greedy matching...? Maybe?

Has anyone else encountered this kind of error before with strip_bbcode()?