WordPress 2.8.5 dashboard not working in Firefox

I’ve been playing with an install of WordPress 2.8.5.. & along with a plethora of other bugs & issues, there was one in particular that stood out.

I couldn’t use the dashboard under Firefox.

It took a little searching, but I found the issue. Here’s how to solve it:

In your [blog root]/wp-admin/load-script.php file, around line 618, there is a line thus (this is all on one line, it’s just wrapping when displayed here):

echo “<script type=’text/javascript’ src='” . esc_attr($src) . “‘></script>\n”;

change it to:

echo “<script type=’text/javascript’ src='” . $src . “‘></script>\n”;

and around line 687 there is a line:

echo “<link rel=’stylesheet’ href='” . esc_attr($href) . “‘ type=’text/css’ media=’all’ />\n”;

change it to:

echo “<link rel=’stylesheet’ href='” . $href . “‘ type=’text/css’ media=’all’ />\n”;

So what’s going on here?

The lines before those two create urls for loading scripts & stylesheets, respectively.

Those urls are then getting run through esc_attr, which turns characters like & into strings like &amp;

Often this is useful, but not here. What it means is that the html that is getting expressed in the page (you can see this if you pull up the dashboard & do a view source) looks like this:

<script type=’text/javascript’ src=’http://[site]/wp-admin/load-scripts.php?c=1&amp;load=jquery,utils,quicktags&amp;ver=b64ae9a301a545332f1fcd4c6c5351b4′></script>

and

<link rel=’stylesheet’ href=’http://[site]/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=dashboard,plugin-install,global,wp-admin &amp;ver=6403d4cb3e6353f406fd43f1b0373ec2′ type=’text/css’ media=’all’ />

Which basically meant that the files weren’t getting loaded at all, the dashboard was looking like complete crap, and, well, not working at all.

The slight changes above simply remove that encoding, resulting in the correct urls:

<script type=’text/javascript’ src=’http://[site]/wp-admin/load-scripts.php?c=1&load=jquery,utils,quicktags&ver=b64ae9a301a545332f1fcd4c6c5351b4′></script>

and

<link rel=’stylesheet’ href=’http://[site]/wp-admin/load-styles.php?c=1&dir=ltr&load=dashboard,plugin-install,global,wp-admin &ver=6403d4cb3e6353f406fd43f1b0373ec2′ type=’text/css’ media=’all’ />

related

  • No Related Posts

November 8th, 2009 | Bugs, Web |
Mastodon