Index: trunk/extensions/ParserFunctions/ParserFunctions.php |
— | — | @@ -172,7 +172,14 @@ |
173 | 173 | |
174 | 174 | function ifexist( &$parser, $title = '', $then = '', $else = '' ) { |
175 | 175 | $title = Title::newFromText( $title ); |
176 | | - return is_object( $title ) && $title->exists() ? $then : $else; |
| 176 | + if ( $title ) { |
| 177 | + $id = $title->getArticleID(); |
| 178 | + $parser->mOutput->addLink( $title, $id ); |
| 179 | + if ( $id ) { |
| 180 | + return $then; |
| 181 | + } |
| 182 | + } |
| 183 | + return $else; |
177 | 184 | } |
178 | 185 | |
179 | 186 | function time( &$parser, $format = '', $date = '' ) { |