jnicklas/carrierwave — pull request #1013 by taavo (2013-03-04 23:36:59+00:00)
Title: process_uri: handle unencoded brackets

Nothing like writing documentation about why a given feature is near impossible to give you ideas on how to implement it relatively elegantly.

We can now handle brackets in filenames. Yes, #1003, I'm talking about you.

How is this possible without being able to parse an invalid URI? Question marks always delimit the query string, so we don't need `URI.parse`—we can just use `split('?')`. Anything before the first question mark should encode brackets. Anything after shouldn't.

(I can also get rid of the known issue I just wrote on this topic. The other characters I was worried about are all fine: colons are permitted, and question marks and hashes always delimit their respective parts of the URL. If there's a problem, it isn't known yet.)