After a lot of testing, I eventually solved the problem by adding these four lines to "function userCanEdit()" in "includes/Title.php"
It's a bit messy and I think the "i"s are not necessary, but I hope this is of use to someone.
if ( preg_match("/:/i",$wgUser->getName()) and !preg_match("/:/i",$this->mDbkeyform) ) { return false; } $pageprefixtext = preg_split("/:/i",$this->mDbkeyform); $userprefixtext = preg_split("/:/i",$wgUser->getName()); if ( preg_match("/:/i",$wgUser->getName()) and preg_match("/:/i",$this->mDbkeyform) and $pageprefixtext[0] != $userprefixtext[0] ) { return false; }