artgris / FileManagerBundle

FileManager is a simple Multilingual File Manager Bundle for Symfony
MIT License
171 stars 89 forks source link

Error 401 When Accessing Parent Folder with "+" in Name #135

Closed BSAGeni closed 4 months ago

BSAGeni commented 6 months ago

Issue Description

When attempting to access a parent folder that contains a "+" character in its name, I encounter an HTTP 401 error. This issue seems to be specific to folders with "+" in their names, as accessing other folders works as expected.

Steps to Reproduce

  1. Create a folder with a "+" in its name (e.g., "example+folder") and naviguate into.
  2. Create a subfolder, whatever its name, and navigate to it.
  3. Click "parent" button.
  4. Observe the HTTP 401 error.

Environment

Potential Fix

This issue is related to URL encoding, as "+" characters are interpreted as spaces in URLs.

Here's a potential fix for the URL issue in the File Manager. The suggested modification aims to correctly handle the parent directory path,.

File: FileManager.php Location of Modification: function getParent() at line 69

Original Code:

$queryParentParameters['route'] = \dirname($this->getCurrentRoute());

Modified Code:

$queryParentParameters['route'] = \dirname($this->getRoute());