jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376476 )

Change subject: BSFoundation: Added missing wfProfileOut calls in 
FileSystemHelper
......................................................................


BSFoundation: Added missing wfProfileOut calls in FileSystemHelper

Change-Id: Ic34375c7e74b46491705b76130a5537372b41b4c
---
M includes/utility/FileSystemHelper.class.php
1 file changed, 12 insertions(+), 4 deletions(-)

Approvals:
  Pwirth: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/utility/FileSystemHelper.class.php 
b/includes/utility/FileSystemHelper.class.php
index 4e0cb4b..97f73d2 100644
--- a/includes/utility/FileSystemHelper.class.php
+++ b/includes/utility/FileSystemHelper.class.php
@@ -9,8 +9,10 @@
         */
        public static function ensureCacheDirectory($sSubDirName = '') {
                wfProfileIn(__METHOD__);
-               if (self::hasTraversal($sSubDirName))
+               if ( self::hasTraversal( $sSubDirName ) ) {
+                       wfProfileOut( __METHOD__ );
                        return Status::newFatal( wfMessage( 
"bs-filesystemhelper-has-path-traversal" ) );
+               }
                if (!empty($sSubDirName) && !preg_match('#^[a-zA-Z/\\\]+#', 
$sSubDirName)) {
                        wfProfileOut(__METHOD__);
                        return Status::newFatal('Requested subdirectory of ' . 
BS_CACHE_DIR . ' contains illegal chars');
@@ -45,8 +47,10 @@
         */
        public static function ensureDataDirectory($sSubDirName = '') {
                wfProfileIn(__METHOD__);
-               if (self::hasTraversal($sSubDirName))
+               if ( self::hasTraversal( $sSubDirName ) ) {
+                       wfProfileOut( __METHOD__ );
                        return Status::newFatal( wfMessage( 
"bs-filesystemhelper-has-path-traversal" ) );
+               }
                if (!empty($sSubDirName) && !preg_match('#^[a-zA-Z/\\\]+#', 
$sSubDirName)) {
                        wfProfileOut(__METHOD__);
                        return Status::newFatal('Requested subdirectory of ' . 
BS_DATA_DIR . ' contains illegal chars');
@@ -84,8 +88,10 @@
        public static function saveToCacheDirectory($sFileName, $data, 
$sSubDirName = '') {
                wfProfileIn(__METHOD__);
                $oStatus = self::ensureCacheDirectory($sSubDirName);
-               if (self::hasTraversal($sSubDirName . DS . $sFileName))
+               if ( self::hasTraversal( $sSubDirName . DS . $sFileName ) ) {
+                       wfProfileOut( __METHOD__ );
                        return Status::newFatal( wfMessage( 
"bs-filesystemhelper-has-path-traversal" ) );
+               }
                if (!$oStatus->isGood()) {
                        wfProfileOut(__METHOD__);
                        return $oStatus;
@@ -109,8 +115,10 @@
        public static function saveToDataDirectory($sFileName, $data, 
$sSubDirName = '') {
                wfProfileIn(__METHOD__);
                $oStatus = self::ensureDataDirectory($sSubDirName);
-               if (self::hasTraversal($sSubDirName . DS . $sFileName))
+               if ( self::hasTraversal( $sSubDirName . DS . $sFileName ) ) {
+                       wfProfileOut( __METHOD__ );
                        return Status::newFatal( wfMessage( 
"bs-filesystemhelper-has-path-traversal" ) );
+               }
                if (!$oStatus->isGood()) {
                        wfProfileOut(__METHOD__);
                        return $oStatus;

-- 
To view, visit https://gerrit.wikimedia.org/r/376476
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic34375c7e74b46491705b76130a5537372b41b4c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Pwirth <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to