Permalink
Browse files

Only doing fwrite and rewind in stream factory when data is present

  • Loading branch information...
1 parent 63d5f0c commit c70c8578d97691e661f9528605e6434788254e72 @mtdowling mtdowling committed Feb 23, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 EntityBody.php
View
@@ -85,8 +85,10 @@ public function rewind()
public static function fromString($string)
{
$stream = fopen('php://temp', 'r+');
- fwrite($stream, $string);
- rewind($stream);
+ if ($string !== '') {
+ fwrite($stream, $string);
+ rewind($stream);
+ }
return new static($stream);
}

0 comments on commit c70c857

Please sign in to comment.