Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Does not handle filepaths with multiple '-' in them #3

Open
rigred opened this issue May 6, 2017 · 0 comments
Open

Does not handle filepaths with multiple '-' in them #3

rigred opened this issue May 6, 2017 · 0 comments

Comments

@rigred
Copy link

rigred commented May 6, 2017

Filepaths such as file-name-something-400x300.jpeg group original would only match up to something

Possible fix to allow regex group original to capture such paths involves changing the regex in DefaultMutator to the below:

protected static $regexp = "/(?<original>[^-].+)-(?<size>(?<width>\d*)x(?<height>\d*))-?(?<signature>[0-9a-z]*)/";

This matches paths in much less time than the old regex too.
This is just a quick and simple fix I implemented, I am by no means a regex expert.

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

No branches or pull requests

1 participant