mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-44061 Ajax: Log whitespace issues to the server error log
This commit is contained in:
parent
76e4de31cc
commit
1fa31fb376
@ -68,11 +68,15 @@ function ajax_check_captured_output() {
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if ($CFG->debugdeveloper && !empty($output)) {
|
||||
// Only throw an error if the site is in debugdeveloper.
|
||||
throw new coding_exception('Unexpected output whilst processing AJAX request. ' .
|
||||
if (!empty($output)) {
|
||||
$message = 'Unexpected output whilst processing AJAX request. ' .
|
||||
'This could be caused by trailing whitespace. Output received: ' .
|
||||
var_export($output, true));
|
||||
var_export($output, true);
|
||||
if ($CFG->debugdeveloper && !empty($output)) {
|
||||
// Only throw an error if the site is in debugdeveloper.
|
||||
throw new coding_exception($message);
|
||||
}
|
||||
error_log('Potential coding error: ' . $message);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user