Skip to content

Commit

Permalink
[import] fix spaces in webdav paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rastislav-chynoransky committed Dec 20, 2024
1 parent bb89f46 commit b75efd9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/Filesystem/WebDAVAdapter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Filesystem;

use League\Flysystem\FileAttributes;
use League\Flysystem\WebDAV\WebDAVAdapter as BaseWebDAVAdapter;

/**
* This class is a workaround for the issue of handling spaces in paths
*/
class WebDAVAdapter extends BaseWebDAVAdapter
{
public function lastModified(string $path): FileAttributes
{
$path = $this->encodePath($path);
return parent::lastModified($path);
}
}
2 changes: 1 addition & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace App\Providers;

use App\Filesystem\WebDAVAdapter;
use App\Elasticsearch\Repositories\AuthorityRepository;
use App\Elasticsearch\Repositories\ItemRepository;
use App\Enums\FrontendEnum;
Expand All @@ -15,7 +16,6 @@
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use League\Flysystem\WebDAV\WebDAVAdapter;
use Sabre\DAV\Client;

class AppServiceProvider extends ServiceProvider
Expand Down

0 comments on commit b75efd9

Please sign in to comment.