Skip to content
This repository has been archived by the owner on Feb 23, 2019. It is now read-only.

Commit

Permalink
Fix Minify on Windows Not Works After PR 423 (#425)
Browse files Browse the repository at this point in the history
* move up the replace

* replace $filename directory separator
  • Loading branch information
nigrosimone authored Feb 26, 2017
1 parent 90e54c5 commit 8fd5901
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Util_Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ static public function url_query( $params = array(), $skip_empty = false,
static public function filename_to_url( $filename, $use_site_url = false ) {

$document_root = Util_Environment::document_root();

if ( DIRECTORY_SEPARATOR != '/' ){
$filename = str_replace(DIRECTORY_SEPARATOR, '/', $filename);
}

if ( substr( $filename, 0, strlen( $document_root ) ) != $document_root ){
return '';
}

$uri_from_document_root = substr($filename, strlen($document_root) - strlen($filename));

if ( DIRECTORY_SEPARATOR != '/' ){
$uri_from_document_root = str_replace( DIRECTORY_SEPARATOR, '/', $uri_from_document_root);
}

$url = home_url($uri_from_document_root);
$url = apply_filters( 'w3tc_filename_to_url', $url );

Expand Down

0 comments on commit 8fd5901

Please sign in to comment.