Skip to content

Commit

Permalink
Issue #78 - don't write trace status report when ..., issue #79 - sup…
Browse files Browse the repository at this point in the history
…port PHP 7.3
  • Loading branch information
bobbingwide committed Aug 16, 2019
1 parent a71c8b8 commit 00317db
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion includes/oik-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,26 @@
*
* Artisteer 4.0 saves information in $theme_ob_stack, so we trace that in case it contains Warnings or Fatal messages.
*
*
* When zlib.output_compression is on then ob_get_status() may return an array like the following.
* ```
* Array
* [name] => (string) "zlib output compression"
* [type] => (integer) 0
* [flags] => (integer) 20512
* [level] => (integer) 1
* [chunk_size] => (integer) 16384
* [buffer_size] => (integer) 20480
* [buffer_used] => (integer) 3935
* ```
*
* In this case should not try to call ob_get_flush() because we get another Notice, due to output handler incompatibilities.
* As a workaround we first check if zlib.output_compression is set in the php.ini file
*/
function bw_trace_output_buffer() {
function bw_trace_output_buffer() {
if ( ini_get( 'zlib.output_compression') ) {
return;
}
//$ob = ob_get_contents();
$status = ob_get_status();

Expand Down Expand Up @@ -570,6 +588,13 @@ function bw_trace_ok_to_echo() {
if ( !$short ) {
$short = bw_array_get( $_REQUEST, "health-check-test-wp_version_check", null );
}
if ( !$short ) {
$action = bw_array_get( $_REQUEST, 'action', null );
$short = $action == 'download_product_csv';
}
if ( !$short ) {
$short = bw_array_get( $_REQUEST, 'block_data_export', null );
}
if ( $short ) {
$ok = false;
} else {
Expand Down

0 comments on commit 00317db

Please sign in to comment.