if ( $local === false ) {
// Assume that all paths are relative to $remote, and make them absolute
- return $remote . '/' . $url;
+ $url = $remote . '/' . $url;
} else {
// We drop the query part here and instead make the path relative to $remote
$url = "{$remote}/{$file}";
}
// If any of these conditions failed (file missing, we don't want to embed it
// or it's not embeddable), return the URL (possibly with ?timestamp part)
- return $url;
}
+ if ( function_exists( 'wfRemoveDotSegments' ) ) {
+ $url = wfRemoveDotSegments( $url );
+ }
+ return $url;
}
/**
array(
'Without trailing slash',
array( 'foo { prop: url(../bar.png); }', false, 'http://example.org/quux', false ),
- 'foo { prop: url(http://example.org/quux/../bar.png); }',
+ 'foo { prop: url(http://example.org/bar.png); }',
),
array(
'With trailing slash on remote (bug 27052)',
array( 'foo { prop: url(../bar.png); }', false, 'http://example.org/quux/', false ),
- 'foo { prop: url(http://example.org/quux/../bar.png); }',
+ 'foo { prop: url(http://example.org/bar.png); }',
),
array(
'Guard against stripping double slashes from query',