Skip to content
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

Reset the phar wrapper #44

Merged

Conversation

magneticmg
Copy link
Contributor

@magneticmg magneticmg commented Apr 11, 2019

As of Joomla! 3.9.4 the phar stream wrapper is re-registered using the typo3/phar-stream-wrapper.

After that, using the joomlatools/composer would fail with an unexpected file extension error.

This PR:

  1. simply resets the phar stream wrapper to the previously set wrapper.

You may want to do a deeper dive into the underlying security concern, but this certainly fixed the immediate issue.

@magneticmg
Copy link
Contributor Author

My previous solution in fact was not working on subsequent composer updates. It misinterpreted what was been stored in the array returned from stream_get_wrapper. The current solution is to use stream_wrapper_restore('phar'); just after the cms is bootstrapped and that seems to help.

@johanjanssens
Copy link
Member

@magneticmg @stevenrombauts Encountered this problem too. Seems to be related to: TYPO3/phar-stream-wrapper#21

Not tested yet, but changing the dependency to 'typo3/phar-stream-wrapper": "^3.1"' should solve it, Joomla is still pointing to 2.1.

Could indeed reset the wrapper on our end when using console, the typo3 one adds additional security, so no harm in that.

@stevenrombauts
Copy link
Member

@magneticmg @johanjanssens Tested this on my end as well, resetting the wrapper sorts out the issue on Joomla 3.9+.

@stevenrombauts stevenrombauts merged commit 1912f36 into joomlatools:master Aug 19, 2020
@johanjanssens
Copy link
Member

Great! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants