Major bug to SFTP external storage

Hello everyone, I discovered a major bug in the external storage app.

I already send a issue #9896 on github , but no solution for this bug at the moment.
Have you encountered this bug? Have you resolved it? Did you find an alternative solution?

This bug occurs when i share a file in SFTP external storage. Editing this file becomes impossible for the user who receives this share.

I have this error message in my log file:

Error	index	Error: Cannot use object of type stdClass as array

    /srv/www/htdocs/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php - line 1166: phpseclib\Net\SFTP->_query_stat_cache('/home/LDAP/paul...')
    /srv/www/htdocs/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php - line 447: phpseclib\Net\SFTP->stat('/home/LDAP/paul...')
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Common.php - line 181: OCA\Files_External\Lib\Storage\SFTP->stat('test.txt/test.t...')
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Common.php - line 323: OC\Files\Storage\Common->filemtime('test.txt/test.t...')
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 378: OC\Files\Storage\Common->hasUpdated('test.txt/test.t...', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 398: OC\Files\Storage\Wrapper\Wrapper->hasUpdated('test.txt/test.t...', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 378: OC\Files\Storage\Wrapper\Availability->hasUpdated('test.txt/test.t...', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 378: OC\Files\Storage\Wrapper\Wrapper->hasUpdated('test.txt/test.t...', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Wrapper/Jail.php - line 382: OC\Files\Storage\Wrapper\Wrapper->hasUpdated('test.txt/test.t...', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 378: OC\Files\Storage\Wrapper\Jail->hasUpdated('test.txt', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/Cache/Watcher.php - line 126: OC\Files\Storage\Wrapper\Wrapper->hasUpdated('test.txt', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/Files/View.php - line 1328: OC\Files\Cache\Watcher->needsUpdate('test.txt', Object(OC\Files\Cache\CacheEntry))
    /srv/www/htdocs/nextcloud/lib/private/Files/View.php - line 1369: OC\Files\View->getCacheEntry(Object(OCA\Files_Trashbin\Storage), 'test.txt', '/home/test.txt')
    /srv/www/htdocs/nextcloud/apps/files_versions/lib/Storage.php - line 184: OC\Files\View->getFileInfo('/paulbachelerie...')
    /srv/www/htdocs/nextcloud/apps/files_versions/lib/Hooks.php - line 61: OCA\Files_Versions\Storage store('/home/test.txt')
    /srv/www/htdocs/nextcloud/lib/private/legacy/hook.php - line 106: OCA\Files_Versions\Hooks write_hook(Array)
    /srv/www/htdocs/nextcloud/lib/private/Files/View.php - line 1261: OC_Hook emit('OC_Filesystem', 'write', Array)
    /srv/www/htdocs/nextcloud/lib/private/Files/View.php - line 1137: OC\Files\View->runHooks(Array, '/shared_with_yo...')
    /srv/www/htdocs/nextcloud/lib/private/Files/View.php - line 688: OC\Files\View->basicOperation('file_put_conten...', '/admin/files/sh...', Array, 'sfcefz\r\nefzefze...')
    /srv/www/htdocs/nextcloud/lib/private/Files/Node/File.php - line 64: OC\Files\View->file_put_contents('/admin/files/sh...', 'sfcefz\r\nefzefze...')
    /srv/www/htdocs/nextcloud/apps/files_texteditor/lib/Controller/FileHandlingController.php - line 171: OC\Files\Node\File->putContent('sfcefz\r\nefzefze...')
    [internal function] OCA\FilesTextEditor\Controller\FileHandlingController->save('/shared_with_yo...', 'sfcefz\r\nefzefze...', 1529312592)
    /srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 161: call_user_func_array(Array, Array)
    /srv/www/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 91: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\FilesTextEditor\Controller\FileHandlingController), 'save')
    /srv/www/htdocs/nextcloud/lib/private/AppFramework/App.php - line 115: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\FilesTextEditor\Controller\FileHandlingController), 'save')
    /srv/www/htdocs/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OCA\\FilesTextEd...', 'save', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
    [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
    /srv/www/htdocs/nextcloud/lib/private/Route/Router.php - line 297: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
    /srv/www/htdocs/nextcloud/lib/base.php - line 999: OC\Route\Router->match('/apps/files_tex...')
    /srv/www/htdocs/nextcloud/index.php - line 42: OC handleRequest()
    {main}

The bug is very easy to reproduce:

  1. Adds a SFTP external storage as an administrator
  2. Chooses the following authentication method : user entered, store in database or
  3. Shares a file (can edit) in the SFTP external storage to a user
  4. Try to change the share (with the user which get the share)

In version 10 of Nextcloud this bug does not exist, it is from version 11 that this bug appears.
For now, here are the components that I suspect: External storage support (Nextcloud 11: 1.0.2, Nextcloud 13: 1.4.1) ? phpseclib ?