* Linker: Follows-up
9ce5ca9886. null is already handled.
* PrefixSearch: Follows-up
337b1e2e. null is already handled.
If other types are bassed, we want to find these.
* UploadBase: Follows-up
11f5ebec28. null is already handled.
WebRequest::getVal($name) can only return string or null.
Change-Id: I3dc3b700cde735f5cd9d497f0867a2b4e3b61f46
$linkText = $text;
$linkTarget = Linker::normalizeSubpageLink( $title, $match[1], $linkText );
- if ( $linkTarget !== null ) {
- $target = Title::newFromText( $linkTarget );
- if ( $target ) {
- if ( $target->getText() == '' && !$target->isExternal()
- && !$local && $title
- ) {
- $newTarget = clone $title;
- $newTarget->setFragment( '#' . $target->getFragment() );
- $target = $newTarget;
- }
-
- $thelink = Linker::makeCommentLink( $target, $linkText . $inside, $wikiId ) . $trail;
+ $target = Title::newFromText( $linkTarget );
+ if ( $target ) {
+ if ( $target->getText() == '' && !$target->isExternal()
+ && !$local && $title
+ ) {
+ $newTarget = clone $title;
+ $newTarget->setFragment( '#' . $target->getFragment() );
+ $target = $newTarget;
}
+
+ $thelink = Linker::makeCommentLink( $target, $linkText . $inside, $wikiId ) . $trail;
}
}
if ( $thelink ) {
$ns = NS_MAIN; // if searching on many always default to main
}
- $t = null;
- if ( is_string( $search ) ) {
- $t = Title::newFromText( $search, $ns );
- }
+ $t = Title::newFromText( $search, $ns );
$prefix = $t ? $t->getDBkey() : '';
$dbr = wfGetDB( DB_SLAVE );
// Yes, the use of getVal() and getText() is wanted, see bug 20365
$oldTitleText = $request->getVal( 'wpOldTitle', $target );
- if ( is_string( $oldTitleText ) ) {
- $this->oldTitle = Title::newFromText( $oldTitleText );
- }
+ $this->oldTitle = Title::newFromText( $oldTitleText );
- if ( $this->oldTitle === null ) {
+ if ( !$this->oldTitle ) {
// Either oldTitle wasn't passed, or newFromText returned null
throw new ErrorPageError( 'notargettitle', 'notargettext' );
}