PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | classes/Base/Stream.php +11 -5 2.0.22.6.1 View file →
@@ -44,15 +44,21 @@
44 44 *
45 45 * @return void
46 46 */
47 47 public function start() {
48 + if ( headers_sent() ) {
49 + // Do not start the stream if headers have already been sent.
50 + return;
51 + }
52 +
48 53 // Disable default disconnect checks.
49 54 ignore_user_abort( true );
50 55
51 56 // phpcs:disable WordPress.PHP.IniSet.Risky, WordPress.PHP.NoSilencedErrors.Discouraged
52 - @ini_set( 'zlib.output_compression', 0 );
53 - @ini_set( 'implicit_flush', 1 );
54 - @ini_set( 'log_limit', 8096 );
57 + @ini_set( 'zlib.output_compression', '0' );
58 + @ini_set( 'implicit_flush', '1' );
59 + @ini_set( 'log_limit', '8096' );
60 +
55 61 @ob_end_clean();
56 62 set_time_limit( 0 );
57 63 // phpcs:enable WordPress.PHP.IniSet.Risky, WordPress.PHP.NoSilencedErrors.Discouraged
58 64
@@ -132,9 +138,9 @@
132 138
133 139 /**
134 140 * Send an error to the client.
135 141 *
136 - * @param string $error Error message.
142 + * @param array{message:string}|string $error Error message.
137 143 *
138 144 * @return void
139 145 */
140 146 public function send_error( $error ) {
@@ -146,7 +152,7 @@
146 152 *
147 153 * @return bool
148 154 */
149 155 public function should_abort() {
150 - return connection_aborted();
156 + return (bool) connection_aborted();
151 157 }
152 158 }