[wp-trac] [WordPress Trac] #39722: wp_upload_dir() causing preg_match(): null byte in regex in wp-includes\functions.php on line 5163

WordPress Trac noreply at wordpress.org
Sat Jan 28 14:00:32 UTC 2017


#39722: wp_upload_dir() causing preg_match(): null byte in regex in wp-
includes\functions.php on line 5163
--------------------------+------------------------------
 Reporter:  indextwo      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.7.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------
Changes (by indextwo):

 * keywords:  needs-patch reporter-feedback => needs-patch


Comment:

 Hey @SergeyBiryukov

 Well spotted - I hadn't even clocked that `$path` wasn't in the
 `preg_replace` - I just found a thing that fixed it and wiped my brow.

 I've just done a `var_dump` and it looks like I'm getting the exact same
 result as you, with the exception of `compress.bzip2`:

 `string(78)
 "(php|file|glob|data|http|ftp|zip|compress.zlib|compress.bzip2|https|ftps|phar)"`

 ...however, I've also just realised that the problem has mysteriously
 disappeared [insert embarrassed emoji here].

 I thought it was super-odd that it appeared out of nowhere yesterday, but
 I assumed it might have been linked to the `4.7.2` update, which happened
 that morning for me. I'd tried restarting all of my services, but hadn't
 tried rebooting my ''actual computer''.

 It might still be worth noting that whatever caused a `null byte` to get
 into the function, using single quotes instead of the double in the regex
 completely solved it.

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


More information about the wp-trac mailing list