Skip to content

Commit

Permalink
Register a link on #ifexist. Otherwise this breaks cache coherency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Starling committed Feb 12, 2007
1 parent 5ea1f08 commit 4dbc7f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ParserFunctions.php
Expand Up @@ -172,7 +172,14 @@ public function rel2abs( &$parser , $to = '' , $from = '' ) {

function ifexist( &$parser, $title = '', $then = '', $else = '' ) {
$title = Title::newFromText( $title );
return is_object( $title ) && $title->exists() ? $then : $else;
if ( $title ) {
$id = $title->getArticleID();
$parser->mOutput->addLink( $title, $id );
if ( $id ) {
return $then;
}
}
return $else;
}

function time( &$parser, $format = '', $date = '' ) {
Expand Down

0 comments on commit 4dbc7f4

Please sign in to comment.