[wp-trac] [WordPress Trac] #51368: Remove windows path check from validate_file

WordPress Trac noreply at wordpress.org
Mon Sep 21 12:38:21 UTC 2020


#51368: Remove windows path check from validate_file
--------------------------+-----------------------------
 Reporter:  zieladam      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Let's talk about `validate_file` function, and specifically about this
 fragment here:

 https://github.com/WordPress/wordpress-
 develop/blob/b984a64c987ae259109bcb08776b1ed22f1dc98f/src/wp-
 includes/functions.php#L5373-L5376

 It checks whether or not the path is a Windows drive path. Why is this
 logic needed? It doesn't seem to play any role or even make sense - why
 allow arbitrary unix paths, but not windows paths? It was introduced 16
 years ago when the function was first created, and even then there was no
 clear explanation why is it even being checked:
 https://core.trac.wordpress.org/changeset/2019.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51368>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list