Closed (fixed)
Project:
Advanced CSS/JS Aggregation
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2019 at 20:20 UTC
Updated:
24 Dec 2019 at 16:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rp7 commentedComment #3
rp7 commentedPatch attached applies the fixes that were applied for the JShrink library @ https://github.com/tedious/JShrink/commit/21254058dc3ce6aba6bef458cff4bf... .
Comment #4
rp7 commentedComment #5
zrhoffman commentedI can reproduce the issue in a fresh install using PHP 7.3 and have verified rp7's patch in #3. `Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest` fails before the patch and succeeds afterwards:
Note that the above test only covers the `continue` within `switch` bug. In order to reproduce the "`strpos()` with `false` as needle" bug at advagg_js_minify/jshrink.inc#L226 , one of the unminified JavaScript files provided by Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest::providerTestMinification() (drupal.js, ajax.js, and ToolbarVisualView.js) would need to end with
)<newline>instead of;<newline>(or add an additional JavaScript file to test). Once that is done, and if advagg_js_minify/jshrink.inc#L269 is patched from #3 but advagg_js_minify/jshrink.inc#L226 is not, the `strpos()` with `false` as needle fix can be verified:Comment #6
acbramley commentedCan confirm #5, I have triggered automated tests on the patch as well.
Comment #7
thallesThanks everyone, looks good to me!
Comment #9
thalles