-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Quote string for special characters. Fixes #3214 #13344
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
Conversation
Windows 10 path might contain `(x64)` (i.e `Program Files (x 82)`) which causes UnexpectedValueException. Refer to magento#3214
Windows is not supported as an operating system per DevDocs. Do you foresee any other cases where this might be relevant? |
@miguelbalparda But it does work in Windows. That patch is not for windows only, it applies to all OS system. See the commit. |
@magento-cicd2 CLA signed. |
@@ -938,7 +938,7 @@ private function accumulateThemeStaticFiles($area, $locale, $filePattern, &$resu | |||
$themePath . "/*_*/web/i18n/{$locale}" | |||
]; | |||
$this->_accumulateFilesByPatterns($paths, $filePattern, $files); | |||
$regex = '#^' . $themePath . | |||
$regex = '#^' . preg_quote($themePath) . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also need to provide the second parameter to preg_quote
to make sure the chose delimiter #
gets escaped, too (so that the escape is always 100% correct).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, right. Thanks @oliverklee
Your description only mentioned Windows, that's why I'm asking. I'm processing a similar PR and the same might apply. |
@miguelbalparda Thanks, miguel. I'll be more specific next time. I'll update the description. |
Actually, not fully, there are some known issues. It was already discussed in some older issues that for good it would be nice to have a proper OS check similar to the PHP version one. Before such check is implemented Windows-only issues and pull requests can be simply closed with an explanation. So, before any fix can be actually merged there should be a corresponding VALID bug scenario first. |
To make things clear, @oliverklee is an independent developer who asked for changes in this PR. |
@miguelbalparda That's correct. :-) As I'm quite new to the Magento project: Is it okay/helpful if I approve PRs that look okay to me, or should this task be limited to dedicated reviewers, core developers or something like this? |
I actually asked the same question today in the maintainers channel :) |
I'll close this for now, will revisit in the future if anything changes. Thanks @reillo! |
Why isn't this fix applied? I'm trying to deploy from a Jenkins server (which runs on Linux), from with a Docker container (that is exactly the proper setup for Magento 2) and I'm also getting this error. If I understand the issue correctly the issue is that I have parenthesis in my path I'm running into this issue in Magento 2.1.12 by the way. I vote to re-open this issue. |
The path might contain regular expression character (i.e
(
) which might cause UnexpectedValueException "Could not parse theme static file". Refer to #3214Description
Fix issue of UnexpectedValueException "Could not parse theme static file" when 'bin/magento setup:static-content:deploy -f' is executed. This will also cause of missing static files.
Fixed Issues (if relevant)
Manual testing scenarios
bin/magento setup:static-content:deploy -f
Contribution checklist