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

Escape path strings to avoid tripping up the regex #233

Merged
merged 1 commit into from Jun 21, 2012
Merged

Escape path strings to avoid tripping up the regex #233

merged 1 commit into from Jun 21, 2012

Conversation

bklang
Copy link
Contributor

@bklang bklang commented Jun 14, 2012

This prevents tmp directories like "/var/folders/TT/TTeZp5JaF4y7rWPBqCM44U+++TI/-Tmp-/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG" from causing RegexpError exceptions like "nested *?+ in regexp: /^/var/folders/TT/TTeZp5JaF4y7rWPBqCM44U+++TI/-Tmp-/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG/"

This prevents tmp directories like "/var/folders/TT/TTeZp5JaF4y7rWPBqCM44U+++TI/-Tmp-/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG" from causing RegexpError exceptions like "nested *?+ in regexp: /^\/var\/folders\/TT\/TTeZp5JaF4y7rWPBqCM44U+++TI\/-Tmp-\/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG/"
@bklang
Copy link
Contributor Author

bklang commented Jun 14, 2012

And to dispel possible confusion, the escaped forward-slashes in the output were from Ruby's output, not the actual content of the string.

sferik added a commit that referenced this pull request Jun 21, 2012
Escape path strings to avoid tripping up the regex
@sferik sferik merged commit dfdc2aa into rails:master Jun 21, 2012
@josevalim
Copy link
Contributor

ECOMMON bros, this pull request should have tests. I have pushed a test and a similar fix (which matches the regexp just once).

@sferik
Copy link
Contributor

sferik commented Jun 29, 2012

Sorry bro, my fault.

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.

None yet

3 participants