I use in an validation script ob_start() and it breaks with a blank screen, just stating Error. Seems to be an error 500. I investigated, there might be memory issues going on. I run ob_start outside of MODx, just as a single line without issues.
Did anybody have similar issues and found a solution?
( Use MODx 1.0.10 with eForm 1.4.4.7 )
Here is an awesome ob_start() MODX snippet by opengeek:
include
<?php
// &file=`assets/foo/bar.php` indicates the file to include
// &return=`1` return explicit content from return statement in included file
// default behavior is to use output buffering to capture the content from the include
$output = '';
if (isset($file) && file_exists($file)) {
if (!isset($return) || $return == false) {
ob_start();
include ($modx->config['base_path'] . $file);
$output = ob_get_contents();
ob_end_clean();
} else {
$output = include ($modx->config['base_path'] . $file);
}
}
return $output;
?>
And another one:
https://forums.modx.com/thread/10353/files-and-documents-question#dis-post-59553
-
☆ A M B ☆
- 1,031 Posts
eFormOnValidate is a function called by eval. So AFAIK you have to clean the output buffer inside this function.