-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Joomla updates will fail when spaces in temp path #35684
Comments
spaces in files and folder names under linux is never recommended afaik |
This comment was marked as abuse.
This comment was marked as abuse.
You're basically right but on local systems (MacOS, Windows) it's not unusal that people have paths to there systems with spaces afaik. |
This comment was marked as abuse.
This comment was marked as abuse.
Thanks for your hint, I placed it here: |
@smohila the correct place for that issue report would have been here: https://github.com/joomla-framework/input/issues |
Steps to reproduce the issue
$config->tmp_path
variable (e.g. /Users/test/files/joomla projects/mysite/tmp)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
The text was updated successfully, but these errors were encountered: