[wp-trac] [WordPress Trac] #48289: wp_normalize_path() breaks path_is_absolute() in Windows.

WordPress Trac noreply at wordpress.org
Fri Oct 11 08:49:20 UTC 2019


#48289: wp_normalize_path() breaks path_is_absolute() in Windows.
----------------------------+-----------------------------
 Reporter:  paultgoodchild  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  General         |    Version:  5.2.3
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 Apologies in advance if this is considered correct behaviour, but it's
 strange that this is the case.

 On **Windows**, when you take an absolute file system path and use
 `wp_normalize_path()` and then pass this result to `path_is_absolute()`,
 you get `false` instead of `true`.

 Super simple demo:

 {{{#!php
 <?php
 var_dump( path_is_absolute( __FILE__ ) );
 var_dump( path_is_absolute( wp_normalize_path( __FILE__ ) ) );

 }}}

 *nix Result:
 {{{
 bool(true)
 bool(true)
 }}}


 Windows Result:
 {{{
 bool(true)
 bool(false)
 }}}

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


More information about the wp-trac mailing list