Page MenuHomePhabricator

OpenID consumer.php broken when database table prefix set
Closed, ResolvedPublic

Description

Author: joeterranova

Description:
For example, say the prefix was 'prefix', so the name of the table was
'prefixuser_openid'

In the function OpenIDGetUser, it sets the tablename to be
"{$wgDBprefix}user_openid". so $tableName is now 'prefixuser_openid'

It then calls $dbr->selectField to select uoi_user from that table. The problem.
selectField /also/ adds the table prefix to the table. So the end result is:

"select uoi_user from prefixprefixuser_openid ..." You get the idea.

I've removed the {$wfDBprefix} from all the functions, and it now works
correctly. This affects almost all the functions in Consumer.php, but not any of
the other files. I'd make the change and commit it, but I don't know enough
about mediawiki to be sure nothing else will be broken. What was the reason this
was done this way? Did earlier versions (I'm on 1.8.2) of the database functions
not add the table prefix automatically? What about $wgSharedDB (which is also
added to the table names in Consumer.php). Do the database functions deal with
that? Did they not used to?


Version: unspecified
Severity: normal
Platform: PC

Details

Reference
bz8361

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:31 PM
bzimport set Reference to bz8361.

sergey.chernyshev wrote:

I don't think this is still the case. Can you confirm that your changes are already in repository?

Thank you,

Sergey

sergey.chernyshev wrote:

This is no longer broken.