In gallery_base.inc the following line should be replaced:
$include = str_replace('&g2_frames', '&g2_frames', $include);

with this line:
$include = str_replace('&g2_frames', '&g2_frames', $include);

This will fix the following bug:
<style type="text/css" media="all">@import "/gallery2/main.php?g2_view=imageframe.CSS&g2_frames=none"</style>

The patch will fix the bug:
<style type="text/css" media="all">@import "/gallery2/main.php?g2_view=imageframe.CSS&amp;g2_frames=none";</style>

Warning: I'm no (PHP) coder! But at least this patch seems to work very well. Code review may be required though.

Comments

profix898’s picture

Status: Needs review » Closed (won't fix)

This line is a workaround for css problems users reported with &amp; urls. By default G2 encodes the url exactly as you suggest. What means you can simply eliminate this line from the module and you should get the url as desired.

However, a few weeks ago I had a lengthy discussion with some users on IRC. The problem is that D5 uses the @import syntax to include css. Some browsers do not load the css correctly if the styles are included with @import AND the url contains &amp;.
If the stylesheets are included with <link type="text/css" rel="stylesheet" ... that's not a problem. The D6 version of gallery module therefore does not contain this hack anymore as D6 switched to the later include method.

dfgfdgdfgdfg’s picture

Do you know which browsers that contain this bug?

PS: I'm strongly against introducing bugs in order to work around a browser bug. I prefer having a W3C compliant website, even when this means some people will see an ugly website in a specific buggy browser. Instead of marking this bug as "won't fix", wouldn't it be possible to add an option to the preferences called "Enable W3C strict mode" with a warning telling it may cause the website to look ugly in some browsers. If this option would be available, I would enable it for sure. I don't care much about being incompatible with Internet Explorer as this browser has a share of only 20% on my website (this includes the newest IE7 version that may not have as much bugs as the older ones). The share of really buggy older IE versions is probably 10% or lower.