[wp-trac] [WordPress Trac] #40292: Use echo file_get_contents() instead of require_once() to pull in SVG file contents in Twenty Seventeen

WordPress Trac noreply at wordpress.org
Wed Mar 29 04:20:02 UTC 2017


#40292: Use echo file_get_contents() instead of require_once() to pull in SVG file
contents in Twenty Seventeen
---------------------------+------------------------------
 Reporter:  kellenmace     |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:  4.7.3
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by dd32):

 I'd probably suggest `readfile()` over `file_get_contents()` as it doesn't
 cause it to be copied to memory before being output.
 Avoiding `include()`/`require()` for non-PHP files seems like a sane
 suggestion. This currently uses `require_once()`, but I can't imagine it'd
 get called twice on a page?

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


More information about the wp-trac mailing list