[wp-trac] [WordPress Trac] #42517: get_file_data() doesn't support the single-line variant of post template headers

WordPress Trac noreply at wordpress.org
Mon Nov 13 17:24:42 UTC 2017


#42517: get_file_data() doesn't support the single-line variant of post template
headers
----------------------------------------+------------------------------
 Reporter:  gschoppe                    |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  General                     |     Version:  4.9
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------------

Comment (by birgire):

 Good point @gschoppe regarding the defined-check.

 Profiling would be interesting.

 [attachment:42517.diff] contains the "old school" replacements. Not all
 files are php files, so maybe an additional check before the replacements?

 It contains a unit test, draft example, that could be extended further. It
 also merged the two existing {{{get_file_data()}}} tests, into the new
 data provider.

 It would be handy if something like vfsStream existed for core tests. Some
 discussions about it in #29544.

 Another thought was to write to a temp file, but probably the way to go
 would be to just include new test files in {{{DIR_TESTDATA}}}.

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


More information about the wp-trac mailing list