jenkins-bot has submitted this change and it was merged. Change subject: Multiversion MWRealm getRealmSpecificFilename: Fix support for filenames without an extension but with full stops in the full path ......................................................................
Multiversion MWRealm getRealmSpecificFilename: Fix support for filenames without an extension but with full stops in the full path So you can do e.g. getRealmSpecificFilename( "$IP/../langlist" ); Bug: T112006 Change-Id: Iccbc93b5787d8c2918669e8416377f3eb0bcfa12 --- M multiversion/MWRealm.php 1 file changed, 5 insertions(+), 7 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/multiversion/MWRealm.php b/multiversion/MWRealm.php index 1676c60..1807be4 100644 --- a/multiversion/MWRealm.php +++ b/multiversion/MWRealm.php @@ -72,14 +72,12 @@ function getRealmSpecificFilename( $filename ) { global $wmfRealm, $wmfDatacenter; - $dotPos = strrpos( $filename, '.' ); - if ( $dotPos === false ) { - $base = $filename; - $ext = ""; - } else { - $base = substr( $filename, 0, $dotPos ); - $ext = substr( $filename, $dotPos ); + $pathinfo = pathinfo( $filename ); + $ext = ''; + if ( isset( $pathinfo['extension'] ) ) { + $ext = '.' . $pathinfo['extension']; } + $base = $pathinfo['dirname'] . DIRECTORY_SEPARATOR . $pathinfo['filename']; // Test existence of the following file suffix and return // immediately whenever found: -- To view, visit https://gerrit.wikimedia.org/r/240612 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iccbc93b5787d8c2918669e8416377f3eb0bcfa12 Gerrit-PatchSet: 4 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Alex Monk <kren...@gmail.com> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits