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

Bugfix/wp regex #60

Merged
merged 2 commits into from
Mar 22, 2019
Merged

Bugfix/wp regex #60

merged 2 commits into from
Mar 22, 2019

Conversation

NickstaDB
Copy link
Contributor

I ran CMSeeK against one of my WP sites and it hung up on "Starting passive theme enumeration". After 10 minutes I investigated and found the regex to be the culprit.

Testing the original regex on https://regex101.com/ caused it to spit out a "catastrophic backtracking" error.

This PR replaces the theme and plugin regexs with simpler ones that achieve the same with less effort - match wp-content/(plugins|themes)/, capture the plugin/theme name, then capture the version number if available. The new regex executed in well under 1s against the same site that the original regex hung up on for over 10 minutes.

@Tuhinshubhra
Copy link
Owner

Yes indeed my regex isn't really that strong.. thanks for improving the project :)

@Tuhinshubhra Tuhinshubhra merged commit e6be137 into Tuhinshubhra:master Mar 22, 2019
@NickstaDB NickstaDB deleted the bugfix/wp-regex branch March 22, 2019 19:03
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

Successfully merging this pull request may close these issues.

2 participants