- $block = Block::newFromTarget( $userObj, $userObj );
- if ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
- if ( $block->getType() == Block::TYPE_RANGE ) {
- $nt = MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget();
+ $block = DatabaseBlock::newFromTarget( $userObj, $userObj );
+ if ( !is_null( $block ) && $block->getType() != DatabaseBlock::TYPE_AUTO ) {
+ if ( $block->getType() == DatabaseBlock::TYPE_RANGE ) {
+ $nt = MediaWikiServices::getInstance()->getNamespaceInfo()->
+ getCanonicalName( NS_USER ) . ':' . $block->getTarget();