From: Brion Vibber Date: Sun, 10 Sep 2006 12:11:36 +0000 (+0000) Subject: * (bug 7279) Use wfBaseName in place of basename() in more places X-Git-Tag: 1.31.0-rc.0~55798 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=cbb9596427c28c877d63d6f5bb8de0855bd3eaf6;p=lhc%2Fweb%2Fwiklou.git * (bug 7279) Use wfBaseName in place of basename() in more places --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3fb24173b6..614601afbf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -190,6 +190,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6887) PHP error for call to getId() on bad input to Special:Revisiondelete * (bug 6888) PHP error for call to getTimestamp() on bad input to Special:Revisiondelete * (bug 7252) Use dvipng support in texvc math rastrization. dvipng is required if texvc is rebuilt. +* (bug 7279) Use wfBaseName in place of basename() in more places + == Languages updated == diff --git a/img_auth.php b/img_auth.php index 4917fe5091..cfe005e936 100644 --- a/img_auth.php +++ b/img_auth.php @@ -18,7 +18,7 @@ if( !isset( $_SERVER['PATH_INFO'] ) ) { # Get filenames/directories $filename = realpath( $wgUploadDirectory . $_SERVER['PATH_INFO'] ); $realUploadDirectory = realpath( $wgUploadDirectory ); -$imageName = $wgContLang->getNsText( NS_IMAGE ) . ":" . basename( $_SERVER['PATH_INFO'] ); +$imageName = $wgContLang->getNsText( NS_IMAGE ) . ":" . wfBaseName( $_SERVER['PATH_INFO'] ); # Check if the filename is in the correct directory if ( substr( $filename, 0, strlen( $realUploadDirectory ) ) != $realUploadDirectory ) { diff --git a/includes/Exif.php b/includes/Exif.php index f9fb9a2c89..2ab0feb13e 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -293,7 +293,7 @@ class Exif { ); $this->file = $file; - $this->basename = basename( $this->file ); + $this->basename = wfBaseName( $this->file ); $this->makeFlatExifTags(); diff --git a/maintenance/FiveUpgrade.inc b/maintenance/FiveUpgrade.inc index f56e62b48e..c9fe2eed18 100644 --- a/maintenance/FiveUpgrade.inc +++ b/maintenance/FiveUpgrade.inc @@ -804,7 +804,7 @@ END; array_shift( $against ); } - array_push( $pieces, basename( $path ) ); + array_push( $pieces, wfBaseName( $path ) ); return implode( '/', $pieces ); } diff --git a/maintenance/dumpHTML.inc b/maintenance/dumpHTML.inc index e0ef494bd2..c22be785b6 100644 --- a/maintenance/dumpHTML.inc +++ b/maintenance/dumpHTML.inc @@ -298,7 +298,7 @@ class DumpHTML { glob( "{$this->sharedStaticDirectory}/thumb/$dir/*" ) ); foreach ( $paths as $path ) { - $file = basename( $path ); + $file = wfBaseName( $path ); if ( !(++$i % REPORTING_INTERVAL ) ) { print "$i\r"; } diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 925c64b720..a2b889ee80 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -32,7 +32,7 @@ if( count( $args ) > 1 ) { # Batch "upload" operation foreach( $files as $file ) { - $base = basename( $file ); + $base = wfBaseName( $file ); # Validate a title $title = Title::makeTitleSafe( NS_IMAGE, $base );