No Code Attached Yet bug
avatar smohila
smohila
27 Sep 2021

Steps to reproduce the issue

  • Set up a path with a space character in the $config->tmp_path variable (e.g. /Users/test/files/joomla projects/mysite/tmp)
  • Start a joomla update in the joomla backend

Expected result

The joomla update process should run through as normal (update from 3.9.27 to 3.10.2).

Actual result

Update could not be installed. Got an error The checksum verification failed. Please make sure you are using the correct update server!.

Reason for this error

In file libraries/vendor/joomla/filter/src/InputFilter.php in method cleanPath (line 1017) a regexp for checking the path for Linux or Windows file systems fails. For Linux systems the patters is defined as:

$linuxPattern = '/^[A-Za-z0-9_\/-]+[A-Za-z0-9_\.-]*([\\\\\/]+[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/';

This pattern does not accept any spaces. Thus a tmp_path containing any spaces will fail.

Solution

The pattern should allow space, e.g.

$linuxPattern = '/^[A-Za-z0-9 _\/-]+[A-Za-z0-9 _\.-]*([\\\\\/]+[A-Za-z0-9 _-]+[A-Za-z0-9 _\.-]*)*$/';

Then the method cleanPath will return the correct path and the update process works as expected.

Additional comments

Tested/reproduced on Joomla! 3.9.27 trying to update to 3.10.2

avatar smohila smohila - open - 27 Sep 2021
avatar smohila smohila - change - 27 Sep 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 27 Sep 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Sep 2021
avatar brianteeman
brianteeman - comment - 27 Sep 2021

spaces in files and folder names under linux is never recommended afaik

avatar PhilETaylor
PhilETaylor - comment - 27 Sep 2021

If you really must add a space in the regex please use '\s' and not just a white space space

avatar smohila
smohila - comment - 27 Sep 2021

spaces in files and folder names under linux is never recommended afaik

You're basically right but on local systems (MacOS, Windows) it's not unusal that people have paths to there systems with spaces afaik.

avatar PhilETaylor
PhilETaylor - comment - 27 Sep 2021

InputFilter is not a Joomla (CMS) class and so this should be addressed upstream in the framework repo if at all.

avatar smohila
smohila - comment - 29 Sep 2021

InputFilter is not a Joomla (CMS) class and so this should be addressed upstream in the framework repo if at all.

Thanks for your hint, I placed it here:
joomla/framework.joomla.org#77

avatar Hackwar
Hackwar - comment - 30 Jan 2023

@smohila the correct place for that issue report would have been here: https://github.com/joomla-framework/input/issues
I'll copy the one from you over.

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment