bug Maintainers Checked Small PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Ars92
Ars92
23 Nov 2022

Pull Request for Issue #39285 .

Summary of Changes

\Joomla\CMS\Filesystem\Folder::create Was checking if the folder you want to create already exists after checking if its parents exist.
I don't see any reason to not check if the folder we want to create already exists before checking for its parents: these changes are for that.

Testing Instructions

  • Install a new site that can be updated to a new Joomla core version.
  • Set PHP open_basedir to include JPATH_ROOT.
  • Apply the patch.
  • Execute the CLI to update Joomla core: php cli/joomla.php core:update

Actual result BEFORE applying this Pull Request

The command crashes:

 6/8 -- Extracting update package ...
Warning: is_dir(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484

Warning: is_dir(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484

Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484

Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484

In Folder.php line 69:
                                    
  [RuntimeException (-1)]           
  Cannot create destination folder  
                                    

Exception trace:
  at /var/www/html/libraries/src/Filesystem/Folder.php:69
 Joomla\CMS\Filesystem\Folder::copy() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:385
 Joomla\CMS\Console\UpdateCoreCommand->copyFileTo() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:331
 Joomla\CMS\Console\UpdateCoreCommand->processUpdatePackage() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:216
 Joomla\CMS\Console\UpdateCoreCommand->updateJoomlaCore() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:168
 Joomla\CMS\Console\UpdateCoreCommand->doExecute() at /var/www/html/libraries/vendor/joomla/console/src/Command/AbstractCommand.php:235
 Joomla\Console\Command\AbstractCommand->execute() at /var/www/html/libraries/vendor/joomla/console/src/Application.php:1181
 Joomla\Console\Application->runCommand() at /var/www/html/libraries/vendor/joomla/console/src/Application.php:403
 Joomla\Console\Application->doExecute() at /var/www/html/libraries/src/Application/ConsoleApplication.php:191
 Joomla\CMS\Application\ConsoleApplication->doExecute() at /var/www/html/libraries/vendor/joomla/console/src/Application.php:448
 Joomla\Console\Application->execute() at /var/www/html/libraries/src/Application/ConsoleApplication.php:234
 Joomla\CMS\Application\ConsoleApplication->execute() at /var/www/html/cli/joomla.php:78

Expected result AFTER applying this Pull Request

Joomla core should update successfully.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar Ars92 Ars92 - open - 23 Nov 2022
avatar Ars92 Ars92 - change - 23 Nov 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Nov 2022
Category Libraries
avatar Ars92 Ars92 - change - 5 Apr 2023
Labels Added: ? Maintainers Checked ?
avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 4.3-dev.

avatar Ars92 Ars92 - change - 2 May 2023
Labels Added: bug
avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 4.4-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Fix CLI core update crash when open_basedir includes JPATH_ROOT (#39285)
[4.4] Fix CLI core update crash when open_basedir includes JPATH_ROOT (#39285)
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.2-dev.

avatar Ars92 Ars92 - change - 15 Nov 2024
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2024-11-15 13:24:26
Closed_By Ars92
Labels Added: Small PR-4.4-dev
Removed: ? ?
avatar Ars92 Ars92 - close - 15 Nov 2024

Add a Comment

Login with GitHub to post a comment