A form I'm working on started giving me a WSOD when I opened it to edit.
I doubled the max_executiion_time parameter in php.ini but it is not always possible to change it (it depends on the server or the host).
This is the culprit code:
The form loaded as expected until 2 or 3 days ago so probably something was changed by a sysadmin on that server but I suspect there's something else here.
bye
maxx
Fatal error: Maximum execution time of 30 seconds exceeded in /.../public_html/libraries/cegcore2/helpers/data_loader.php on line 148Other simpler forms open as usual.
I doubled the max_executiion_time parameter in php.ini but it is not always possible to change it (it depends on the server or the host).
This is the culprit code:
private function textarea(&$html){I don't understand how a str_replace function could exceed 30 seconds substituting text on some element of a form.
//textarea fields
$pattern = '/<textarea([^>]*?)>(.*?)<\/textarea>/is';
preg_match_all($pattern, $html, $matches);
if(!empty($matches)){
foreach($matches[0] as $field){
if(strpos($field, 'data-ghost=') !== false){
continue;
}
preg_match($this->name_pattern, $field, $name_attr);
if(!empty($name_attr[2])){
$field_name = $name_attr[2];
$data_value = $this->getValue($field_name);
if($data_value !== false){
$updated_field = preg_replace($this->textarea_pattern, '${1}'.str_replace(['\\', '$'], ['\\\\', '\$'], $data_value).'${4}', $field);
$html = str_replace($field, $updated_field, $html); // <<<---
}
}
}
}
}
The form loaded as expected until 2 or 3 days ago so probably something was changed by a sysadmin on that server but I suspect there's something else here.
bye
maxx