PluginProbe
The WP Remote WordPress Plugin / 6.36
The WP Remote WordPress Plugin v6.36
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
← All changes | callback/streams.php +12 -2 5.426.36 View file →
@@ -1,6 +1,13 @@
1 1 <?php
2 -
2 +// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_operations_fread
3 +// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
4 +// phpcs:disable WordPress.WP.AlternativeFunctions.file_system_operations_fsockopen
5 +// We use php method like fread, fwrite to read only a portion of a file, we don't have a direct method for partial reads since WP_Filesystem doesn't support a direct equivalent to fread, fwrite.
6 +// The entire file deals with custom stream handling
7 +// We need direct socket/file operations for this functionality
8 +// WordPress filesystem alternatives wouldn't work for this use case
9 +// It's better to disable these specific rules at file level than adding individual ignore comments
3 10 if (!defined('ABSPATH')) exit;
4 11 if (!class_exists('BVRespStream')) :
5 12
6 13 class BVStream extends BVCallbackBase {
@@ -76,11 +83,13 @@
76 83 $this->bvboundry = $request->bvboundry;
77 84 }
78 85
79 86 public function writeChunk($chunk) {
87 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- chunk should not be escaped
80 88 echo $this->bvboundry . "ckckckckck" . $chunk . $this->bvboundry . "ckckckckck";
81 89 }
82 90 public function endStream() {
91 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
83 92 echo $this->bvboundry . "rerererere";
84 93
85 94 return array();
86 95 }
@@ -168,9 +177,9 @@
168 177 $mph = array(
169 178 "Content-Disposition" => "form-data; name=bvinfile; filename=data",
170 179 "Content-Type" => "application/octet-stream"
171 180 );
172 - $rnd = rand(100000, 999999);
181 + $rnd = rand(100000, 999999); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_rand
173 182 $this->boundary = "----".$rnd;
174 183 $prologue = "--".$this->boundary."\r\n";
175 184 foreach($mph as $key=>$val) {
176 185 $prologue .= $key.":".$val."\r\n";
@@ -243,5 +252,6 @@
243 252 }
244 253 return $response;
245 254 }
246 255 }
256 +// phpcs:enable
247 257 endif;