Fix DatabaseBase::replaceVars for PHP 5.3

Change-Id: I78a535abfe3f444b2ccb99638a63b6f16c9f18af