dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c436c3
)
Normalize / to DIRECTORY_SEPARATOR in wfRelativePath() input, plays nicer on Windows
author
Brion Vibber
<brion@users.mediawiki.org>
Fri, 19 Jan 2007 10:40:57 +0000
(10:40 +0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Fri, 19 Jan 2007 10:40:57 +0000
(10:40 +0000)
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
4976055
..
950d029
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-1857,6
+1857,10
@@
function wfBaseName( $path ) {
* @return string
*/
function wfRelativePath( $path, $from ) {
* @return string
*/
function wfRelativePath( $path, $from ) {
+ // Normalize mixed input on Windows...
+ $path = str_replace( '/', DIRECTORY_SEPARATOR, $path );
+ $from = str_replace( '/', DIRECTORY_SEPARATOR, $from );
+
$pieces = explode( DIRECTORY_SEPARATOR, dirname( $path ) );
$against = explode( DIRECTORY_SEPARATOR, $from );
$pieces = explode( DIRECTORY_SEPARATOR, dirname( $path ) );
$against = explode( DIRECTORY_SEPARATOR, $from );