Pwirth has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/358001 )

Change subject: BSFoundation: Removed deprecated ContextActive for 
SecureFilestore
......................................................................

BSFoundation: Removed deprecated ContextActive for SecureFilestore

=> Follow up for: I810a927410447b8e57d57cb38db28383bbc84fa4

Change-Id: Id10e85a13522ad692f10d2da4bb93db2e50191e9
---
M includes/api/BSApiFileBackendStore.php
M includes/outputhandler/views/view.UserMiniProfile.php
M includes/skins/BsBaseTemplate.php
M includes/utility/FileSystemHelper.class.php
4 files changed, 29 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/01/358001/1

diff --git a/includes/api/BSApiFileBackendStore.php 
b/includes/api/BSApiFileBackendStore.php
index 048f7e1..4ad2c0d 100644
--- a/includes/api/BSApiFileBackendStore.php
+++ b/includes/api/BSApiFileBackendStore.php
@@ -310,8 +310,8 @@
        }
 
        protected function addSecondaryFields( $aTrimmedData ) {
-               $bUseSecureFileStore = BsExtensionManager::isContextActive(
-                       'MW::SecureFileStore::Active'
+               $oSecureFileStore = BsExtensionManager::getExtension(
+                       'SecureFileStore'
                );
 
                foreach( $aTrimmedData as $oDataSet ) {
@@ -325,7 +325,9 @@
                        //TODO: Make thumb size a parameter
                        $sThumb = $oImg->createThumb( 120 );
                        $sUrl = $oImg->getUrl();
-                       if( $bUseSecureFileStore ) { //TODO: Remove
+
+                       //TODO: Remove, when SecureFileStore is finally removed
+                       if( $oSecureFileStore ) {
                                $sThumb = html_entity_decode( 
SecureFileStore::secureStuff( $sThumb, true ) );
                                $sUrl = html_entity_decode( 
SecureFileStore::secureStuff( $sUrl, true ) );
                        }
diff --git a/includes/outputhandler/views/view.UserMiniProfile.php 
b/includes/outputhandler/views/view.UserMiniProfile.php
index 6c38167..6f44291 100644
--- a/includes/outputhandler/views/view.UserMiniProfile.php
+++ b/includes/outputhandler/views/view.UserMiniProfile.php
@@ -42,9 +42,14 @@
 
                $sOut = implode( "\n", $aOut );
 
+               $oSecureFileStore = BsExtensionManager::getExtension(
+                       'SecureFileStore'
+               );
                // CR RBV (03.06.11 08:39): Hook/Event!
-               if ( BsExtensionManager::isContextActive( 
'MW::SecureFileStore::Active' ) )
-                       $sOut = SecureFileStore::secureFilesInText($sOut);
+               //TODO: Remove, when SecureFileStore is finally removed
+               if ( $oSecureFileStore ) {
+                       $sOut = SecureFileStore::secureFilesInText( $sOut );
+               }
 
                return $sOut;
        }
diff --git a/includes/skins/BsBaseTemplate.php 
b/includes/skins/BsBaseTemplate.php
index b19cb41..c396f6a 100644
--- a/includes/skins/BsBaseTemplate.php
+++ b/includes/skins/BsBaseTemplate.php
@@ -435,7 +435,13 @@
                                                        $sText = $aVal[0];
 
                                                        if ( is_object( $oFile 
) && $oFile->exists() ) {
-                                                               if ( 
BsExtensionManager::isContextActive( 'MW::SecureFileStore::Active' ) ) {
+                                                               //TODO: Remove, 
when SecureFileStore is finally
+                                                               //removed
+                                                               
$oSecureFileStore
+                                                                       = 
BsExtensionManager::getExtension(
+                                                                       
'SecureFileStore'
+                                                               );
+                                                               if ( 
$oSecureFileStore ) {
                                                                        $sUrl = 
SecureFileStore::secureStuff( $oFile->getUrl(), true );
                                                                } else {
                                                                        $sUrl = 
$oFile->getUrl();
diff --git a/includes/utility/FileSystemHelper.class.php 
b/includes/utility/FileSystemHelper.class.php
index dbddd59..cc5e5f0 100644
--- a/includes/utility/FileSystemHelper.class.php
+++ b/includes/utility/FileSystemHelper.class.php
@@ -623,8 +623,16 @@
                if ( $status->isGood() && $oRepoFile !== false ){
                        $oPage = WikiPage::factory( $oRepoFile->getTitle() );
                        $oPage->doEditContent( new WikitextContent( $sPageText 
), '' );
-                       if ( BsExtensionManager::isContextActive( 
'MW::SecureFileStore::Active' ) ) {
-                               return 
Status::newGood(SecureFileStore::secureStuff( $oRepoFile->getUrl(), true) );
+
+                       //TODO: Remove, when SecureFileStore is finally removed
+                       $oSecureFileStore = BsExtensionManager::getExtension(
+                               'SecureFileStore'
+                       );
+                       if ( $oSecureFileStore ) {
+                               return Status::newGood( 
SecureFileStore::secureStuff(
+                                       $oRepoFile->getUrl(),
+                                       true
+                               ));
                        }
                        else{
                                return Status::newGood( $oRepoFile->getUrl(), 
true );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id10e85a13522ad692f10d2da4bb93db2e50191e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Pwirth <wi...@hallowelt.biz>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to