MDL-51603 dataformats: coding_exception if output buffering

This commit is contained in:
David Monllao 2016-04-21 14:47:09 +08:00
parent 5b95105600
commit 9df4ae4189
4 changed files with 5 additions and 10 deletions

View file

@ -38,8 +38,8 @@
*/
function download_as_dataformat($filename, $dataformat, $columns, $iterator, $callback = null) {
if (!NO_OUTPUT_BUFFERING) {
throw new coding_exception("NO_OUTPUT_BUFFERING must be set to true before calling download_as_dataformat");
if (ob_get_length()) {
throw new coding_exception("Output can not be buffered before calling download_as_dataformat");
}
$classname = 'dataformat_' . $dataformat . '\writer';