[wp-trac] [WordPress Trac] #29525: New media - media-new.php broken

WordPress Trac noreply at wordpress.org
Fri Feb 20 09:08:08 UTC 2015


#29525: New media - media-new.php broken
-------------------------------+------------------------------
 Reporter:  aliwebdesarrollo   |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  3.8.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by SergeyBiryukov):

 > The change will be:
 > remove:
 > $this->image = @imagecreatefromstring( file_get_contents( $this->file )
 );
 >
 > change by:
 > $this->image = @imagecreatefromstring( readfile( $this->file ) );

 [http://php.net/manual/en/function.readfile.php readfile()] returns the
 number of bytes read from the file, while
 [http://php.net/manual/en/function.imagecreatefromstring.php
 imagecreatefromstring()] here specifically requires the file contents as a
 string. So it doesn't seem like a direct replacement would work as
 expected.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29525#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list