ericmckean / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Ampersands not escaped in generated URIs #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just a quick note, i loved minify but i think i had to validate my pages
just after installation. 

builder generated invalid html uri for me;
http://validator.w3.org/ says 
"If you want to use a literal ampersand in your document you must encode it
as "&" (even inside URLs!)."

so i changed this 
<script type="text/javascript"
src="http://www.mydomain.com/min/b=highslide&f=jquery.js,facebox.js,highslide.js
,init.js"></script>
to this:
<script type="text/javascript"
src="http://www.mydomain.com/min/b=highslide&amp;f=jquery.js,facebox.js,highslid
e.js,init.js"></script>

Basically "&f=" should be "&amp;f="

Original issue reported on code.google.com by kusadasi...@gmail.com on 24 Jan 2009 at 6:09

GoogleCodeExporter commented 9 years ago
Ampersands in URIs are perfectly valid, they only need escaping in HTML. The 
builder 
already does this. Eg. it generates:

URI  : /min/?b=hello&f=1.css,2.css
HTML : <link type="text/css" rel="stylesheet" href="/min/?
b=hello&f=1.css,2.css" />

The generated HTML output is valid.

Original comment by mrclay....@gmail.com on 25 Jan 2009 at 4:30

GoogleCodeExporter commented 9 years ago
Hey Clay, you are doing fantastic job, thank you for that.

I am sure it does generate escaped ampersands but i copied and pasted the code 
which
builder generated. And i wasnt so careful when i added to my pages manually. 
What i
mean is some users may miss it and it may create some problems. Thats why i 
wanted to
bring into your attention. 

I love minify. it is like a life saver ;)

Greetings, Clay...

Original comment by kusadasi...@gmail.com on 25 Jan 2009 at 4:39