I am using xtemplate which is an XML templating engine for php. I wrote a search script. One of the components of the search script is a search box. When I search for an artist name that exists in the database in the search box I get the following error. I don't have this problem with any other part of the site.
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3197 bytes) in /home/httpd/vhosts/lineskipper.com/httpdocs/xtemplate/xtemplate.class.php on line 405
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 142 bytes) in Unknown on line 0
$var = trim($var);
// SF Bug no. 810773 - thanks anonymous
$var = str_replace('\\', '\\\\', $var);
// Ensure dollars in strings are not evaluated reported by SadGeezer 31/3/04
$var = str_replace('$', '\\$', $var);
// Replace str_replaces with preg_quote
//$var = preg_quote($var);
$var = str_replace('\\|', '|', $var);
// line 405
$copy=preg_replace("|" . $this->tag_start_delim . $v . " ?#?" . $comments . $this->tag_end_delim . "|", "$var", $copy);