Robert Vogel has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231223
Change subject: check for input, happens to be a full path already
......................................................................
check for input, happens to be a full path already
Change-Id: I3583e6591a0cb117d54bdca757676f7230dd977d
(cherry picked from commit 8bb0024f594a26f5279c65e9077572d7870b5bba)
---
M includes/utility/FileSystemHelper.class.php
1 file changed, 6 insertions(+), 5 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation
refs/changes/23/231223/1
diff --git a/includes/utility/FileSystemHelper.class.php
b/includes/utility/FileSystemHelper.class.php
index b2dc13b..5ae1f3b 100644
--- a/includes/utility/FileSystemHelper.class.php
+++ b/includes/utility/FileSystemHelper.class.php
@@ -58,20 +58,21 @@
}
}
- if (empty($sSubDirName)) {
+ $sFullPath = strpos( $sSubDirName, BS_DATA_DIR ) === 0 ?
$sSubDirName : BS_DATA_DIR . DS . $sSubDirName;
+ if ( empty( $sFullPath ) ) {
wfProfileOut(__METHOD__);
return Status::newGood(BS_DATA_DIR);
- } elseif (is_dir(BS_DATA_DIR . DS . $sSubDirName)) {
+ } elseif ( is_dir( $sFullPath ) ) {
wfProfileOut(__METHOD__);
- return Status::newGood(BS_DATA_DIR . DS . $sSubDirName);
+ return Status::newGood( $sFullPath );
}
- if (!mkdir(BS_DATA_DIR . DS . $sSubDirName, 0777, true)) {
+ if ( !mkdir( $sFullPath, 0777, true ) ) {
wfProfileOut(__METHOD__);
return Status::newFatal(BS_DATA_DIR . ' is not
accessible');
}
wfProfileOut(__METHOD__);
- return Status::newGood(BS_DATA_DIR . DS . $sSubDirName);
+ return Status::newGood( $sFullPath );
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/231223
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3583e6591a0cb117d54bdca757676f7230dd977d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_23
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Tweichart <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits