Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

bug fix #3

Closed
wants to merge 4 commits into from
Closed

bug fix #3

wants to merge 4 commits into from

Conversation

GerHobbelt
Copy link
Contributor

fix for bug where JS contains regex(s) with [...] sets, which themselves contain the regex start marker '/', e.g. mootools:

Example:
mootools Form.Validator near line 460:
return Form.Validator.getValidator('IsEmpty').test(element) || (/^(?:[a-z0-9!#$%&'+/=?^{|}~-].?){0,63}[a-z0-9!#$%&'_+/=?^_{|}~-]@(?:(?:a-z0-9?.)*a-z0-9?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)])$/i).test(element.get('value'));

Also note that another edit syncs the PHP code to the original jsmin.c code (see the diff; it's one if(...) that's augmented that's the important bit there.

Thanks for your excellent work; it's been quite useful!

…ves contain the regex start marker '/', e.g. mootools:

Example:
  mootools Form.Validator near line 460:
    return Form.Validator.getValidator('IsEmpty').test(element) || (/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(element.get('value'));
@rgrove
Copy link
Owner

rgrove commented Jan 17, 2011

I'll definitely take 546bf3b. Thanks!

Have you measured the speedup from d9f1909?

Regarding d9f1909 and a47c82a: my goal with jsmin-php (at least in the main branch) is absolute parity with jsmin.c (even bugs) so that developers can rely on the output from one always matching the output from the other. I may pull these and other original changes into a separate branch though, for the sake of people who want an improved JSMin port.

The .gitignore changes are probably best kept in your own global gitignore config, since they don't pertain to this project specifically.

@rgrove
Copy link
Owner

rgrove commented Jan 17, 2011

Cherry-picked 546bf3b into master and merged the rest into a new "extras" branch. Thanks!

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants