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

Minify generates minified content twice when not given an explicit path. #1152

Closed
phellamon opened this issue Jun 3, 2019 · 6 comments
Closed

Comments

@phellamon
Copy link

FFF: version 3.6
File: Web.php
Function: minify()

To reproduce: echo minify(["your_javascript_file.js"]);

Result: the content of the file is minified twice and concatenated. ( ... causing javascript to run twice once received by the browser ...)

Cause: line 587: $path=$fw->get('UI').';./'; results in $path being "./;./;" causing the foreach statement on line 588 to run twice for the "./" directory.

Expected result: the minified content should be returned only once.

Solution: remove doubles on the result of $fw->split($path,FALSE)

Workaround: call minify() with an explicit "./" path parameter.

ikkez added a commit to f3-factory/fatfree-core that referenced this issue Nov 27, 2019
ikkez added a commit to f3-factory/fatfree-core that referenced this issue Nov 27, 2019
@dduers
Copy link

dduers commented Nov 28, 2019

I feel like there is something broken now (F3 3.7.0) ... I pass a comma separated list of files to the minifyer and only the first file is included. Am I doing wrong? Under F3 3.6.5 it had worked.

echo \Web::instance()->minify("file1.js,file2.js,file3.js", null, true, 'js/');

@leonardfischer
Copy link

Hey @dduers I notices something similiar earlier today and opened an issue: f3-factory/fatfree-core#289

@dduers
Copy link

dduers commented Nov 28, 2019

Hey @dduers I notices something similiar earlier today and opened an issue: bcosca/fatfree-core#289

You already closed your issue?

@leonardfischer
Copy link

Hey @dduers
I didn't close my issue - I think what you are seeing is "this" issue being referenced by my comment ;)

@dduers
Copy link

dduers commented Nov 28, 2019

@leonardfischer yes, ok

@ikkez
Copy link
Collaborator

ikkez commented Nov 28, 2019

It's already solved here. please checkout latest dev version... will release a patch version soon

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

No branches or pull requests

4 participants