How to fix _weak_escape() error after upgrading to WordPress 2.8

I just got the WordPress error: Call to undefined function: _weak_escape() when trying to login to WordPress admin after upgrading to WordPress 2.8.

I looked it up and someone mentioned it was a problem to do with the redirection plugin – but to hell with disabling that, I love that plugin!!! So instead I looked into the file causing the problem:
wp-includes/wp-db.php

At a further look it didn’t seem to like the function _weak_escape, so I simply found what this function did, all it does is addslashes, so I embedded this into the code which was calling _weak_escape and hey presto! It works!

Here is the full code I used:
function escape($data) {
if ( is_array($data) ) {
foreach ( (array) $data as $k => $v ) {
if ( is_array($v) )
$data[$k] = $this->escape( $v );
else
$data[$k] = addslashes($v);
}
} else {
$data = addslashes($data);
}
return $data;
}

Hope that helps some of you out there!

I realise this isn’t the best fix for it – ideally you want to get it so it doesn’t believe _weak_escape is an undefined function – but I’m not sure what the cause of this is, I imagine I could try removing the underscore or searching at php.net – but it’s late and I want to go to bed! If you find the solution please let me know in the comments and I’ll give you a link :)

SEO in Ripon

Today I managed to get My first commercial SEO related number one ranking – SEO Ripon.

SEO Ripon, my first #1 SEO commercial term

SEO Ripon, my first #1 SEO commercial term

I wasn’t even aiming for it, but I seem to have managed it, quite pleased to be honest! I’m also ranking #1 for SEO specialist North Yorkshire, but lets face it – both of the terms are very, very long tail. I’m hoping to get onto page one or two for SEO Specialist (currently ranking on page 7 – eek!) – I’m currently #3 on page 1 for this term :)

Anyways if you are in Ripon, feel free to contact me :)

SEO Specialist – my new target term

Well I’ve got bored trying to rank #1 for David Whitehouse – so whilst I’m getting on with that I’m going to play around trying to rank for a commercial term: seo specialist.

Dave currently ranks number 1 for UK SEO, and Ant is trying to rank for that one too, so I thought I’d target something else, since that base is pretty much covered (plus I reckon this one is going to be easier).

We’ll see how I do :)

Feedback Form