File tree 1 file changed +11
-18
lines changed
1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,6 @@ public function getIterator(): Iterator
77
77
throw new RuntimeException ('Unable to create temporary stream. ' );
78
78
}
79
79
80
- // Empty content means nothing to transport, nothing to seek
81
- if (!$ contentSize ) {
82
- return $ stream ;
83
- }
84
-
85
80
$ bytes = stream_copy_to_stream ($ this ->stream , $ stream , $ contentSize );
86
81
87
82
if ($ bytes !== $ contentSize ) {
@@ -127,19 +122,17 @@ public function getIterator(): Iterator
127
122
if (!$ usage ->used ()) {
128
123
$ usage ->use ();
129
124
$ content ->close ();
130
- if ($ contentSize ) {
131
- // Skip unused content
132
- $ bytes = fseek ($ this ->stream , $ contentSize + $ contentPadding , SEEK_CUR );
133
-
134
- if ($ bytes === -1 ) {
135
- throw new InvalidArchiveFormatException (
136
- sprintf (
137
- 'Invalid TAR archive format: Unexpected end of file at position: %s, expected %d bytes of content and block padding ' ,
138
- $ blockStart ,
139
- $ contentSize + $ contentPadding ,
140
- )
141
- );
142
- }
125
+ // Skip unused content
126
+ $ bytes = fseek ($ this ->stream , $ contentSize + $ contentPadding , SEEK_CUR );
127
+
128
+ if ($ bytes === -1 ) {
129
+ throw new InvalidArchiveFormatException (
130
+ sprintf (
131
+ 'Invalid TAR archive format: Unexpected end of file at position: %s, expected %d bytes of content and block padding ' ,
132
+ $ blockStart ,
133
+ $ contentSize + $ contentPadding ,
134
+ )
135
+ );
143
136
}
144
137
}
145
138
}
You can’t perform that action at this time.
0 commit comments