This repository was archived by the owner on Mar 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ <form method="post" action="" enctype="multipart/form-data">
2
+ <input type="file" name="file[x][y]">
3
+ <input type="submit" value="submit">
4
+ </form>
5
+ <?php if (isset ($ _FILES ['file ' ]['error ' ]['x ' ]['y ' ]) && is_int ($ _FILES ['file ' ]['error ' ]['x ' ]['y ' ])): ?>
6
+ <?php if ($ _FILES ['file ' ]['error ' ]['x ' ]['y ' ] === UPLOAD_ERR_OK ): ?>
7
+ <div id="success">SUCCESS</div>
8
+ <?php else : ?>
9
+ <div id="error">ERROR:<?= $ _FILES ['file ' ]['error ' ]['x ' ]['y ' ]?> </div>
10
+ <?php endif ; ?>
11
+ <?php endif ; ?>
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ private function pipe($client, $server)
82
82
{
83
83
$ lines = [];
84
84
$ length = null ;
85
+ $ body = '' ;
85
86
while (true ) {
86
87
$ line = @fgets ($ client );
87
88
if ($ line === false ) {
@@ -95,7 +96,11 @@ private function pipe($client, $server)
95
96
break ;
96
97
}
97
98
}
98
- $ body = $ length !== null ? fread ($ client , $ length ) : '' ;
99
+ if ($ length !== null ) {
100
+ while (strlen ($ body ) < $ length ) {
101
+ $ body .= fread ($ client , $ length );
102
+ }
103
+ }
99
104
fwrite ($ server , implode ($ lines ) . $ body );
100
105
fwrite ($ client , stream_get_contents ($ server ));
101
106
}
You can’t perform that action at this time.
0 commit comments