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 +17 -4 5.226.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 {
@@ -68,17 +75,22 @@
68 75 }
69 76 }
70 77
71 78 class BVRespStream extends BVStream {
79 + public $bvboundry;
80 +
72 81 function __construct($request) {
73 82 parent::__construct($request);
83 + $this->bvboundry = $request->bvboundry;
74 84 }
75 85
76 86 public function writeChunk($chunk) {
77 - echo "ckckckckck".$chunk."ckckckckck";
87 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- chunk should not be escaped
88 + echo $this->bvboundry . "ckckckckck" . $chunk . $this->bvboundry . "ckckckckck";
78 89 }
79 90 public function endStream() {
80 - echo "rerererere";
91 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
92 + echo $this->bvboundry . "rerererere";
81 93
82 94 return array();
83 95 }
84 96 }
@@ -165,9 +177,9 @@
165 177 $mph = array(
166 178 "Content-Disposition" => "form-data; name=bvinfile; filename=data",
167 179 "Content-Type" => "application/octet-stream"
168 180 );
169 - $rnd = rand(100000, 999999);
181 + $rnd = rand(100000, 999999); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_rand
170 182 $this->boundary = "----".$rnd;
171 183 $prologue = "--".$this->boundary."\r\n";
172 184 foreach($mph as $key=>$val) {
173 185 $prologue .= $key.":".$val."\r\n";
@@ -240,5 +252,6 @@
240 252 }
241 253 return $response;
242 254 }
243 255 }
256 +// phpcs:enable
244 257 endif;