]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Storage.php
Some removed escapeTags calls
[friendica.git] / src / Module / Admin / Storage.php
index 6b22d905cf2474cbb6f48f17a7f32aa238099d59..51e70d841ebc73eba194a95627ea649e7e499ff4 100644 (file)
@@ -23,9 +23,9 @@ namespace Friendica\Module\Admin;
 
 use Friendica\Core\Renderer;
 use Friendica\DI;
-use Friendica\Model\Storage\InvalidClassStorageException;
-use Friendica\Model\Storage\IStorageConfiguration;
-use Friendica\Model\Storage\IWritableStorage;
+use Friendica\Core\Storage\Exception\InvalidClassStorageException;
+use Friendica\Core\Storage\Capability\ICanConfigureStorage;
+use Friendica\Core\Storage\Capability\ICanWriteToStorage;
 use Friendica\Module\BaseAdmin;
 use Friendica\Util\Strings;
 
@@ -37,10 +37,10 @@ class Storage extends BaseAdmin
 
                self::checkFormSecurityTokenRedirectOnError('/admin/storage', 'admin_storage');
 
-               $storagebackend = Strings::escapeTags(trim($parameters['name'] ?? ''));
+               $storagebackend = trim($parameters['name'] ?? '');
 
                try {
-                       /** @var IStorageConfiguration|false $newStorageConfig */
+                       /** @var ICanConfigureStorage|false $newStorageConfig */
                        $newStorageConfig = DI::storageManager()->getConfigurationByName($storagebackend);
                } catch (InvalidClassStorageException $storageException) {
                        notice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend));
@@ -78,7 +78,6 @@ class Storage extends BaseAdmin
 
                if (!empty($_POST['submit_save_set'])) {
                        try {
-                               /** @var IWritableStorage $newstorage */
                                $newstorage = DI::storageManager()->getWritableStorageByName($storagebackend);
 
                                if (!DI::storageManager()->setBackend($newstorage)) {
@@ -129,7 +128,7 @@ class Storage extends BaseAdmin
                                'name'   => $name,
                                'prefix' => $storage_form_prefix,
                                'form'   => $storage_form,
-                               'active' => $current_storage_backend instanceof IWritableStorage && $name === $current_storage_backend::getName(),
+                               'active' => $current_storage_backend instanceof ICanWriteToStorage && $name === $current_storage_backend::getName(),
                        ];
                }
 
@@ -147,7 +146,7 @@ class Storage extends BaseAdmin
                        '$noconfig'              => DI::l10n()->t('This backend doesn\'t have custom settings'),
                        '$baseurl'               => DI::baseUrl()->get(true),
                        '$form_security_token'   => self::getFormSecurityToken("admin_storage"),
-                       '$storagebackend'        => $current_storage_backend instanceof IWritableStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
+                       '$storagebackend'        => $current_storage_backend instanceof ICanWriteToStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
                        '$availablestorageforms' => $available_storage_forms,
                ]);
        }