Index: trunk/phase3/includes/Article.php |
— | — | @@ -3552,27 +3552,26 @@ |
3553 | 3553 | __METHOD__ ); |
3554 | 3554 | |
3555 | 3555 | global $wgContLang; |
3556 | | - |
3557 | | - if( $res !== false ) { |
3558 | | - foreach( $res as $row ) { |
3559 | | - $tlTemplates[] = $wgContLang->getNsText( $row->tl_namespace ) . ':' . $row->tl_title ; |
3560 | | - } |
| 3556 | + foreach( $res as $row ) { |
| 3557 | + $tlTemplates["{$row->tl_namespace}:{$row->tl_title}"] = true; |
3561 | 3558 | } |
3562 | 3559 | |
3563 | 3560 | # Get templates from parser output. |
3564 | | - $poTemplates_allns = $parserOutput->getTemplates(); |
3565 | | - |
3566 | | - $poTemplates = array (); |
3567 | | - foreach ( $poTemplates_allns as $ns_templates ) { |
3568 | | - $poTemplates = array_merge( $poTemplates, $ns_templates ); |
| 3561 | + $poTemplates = array(); |
| 3562 | + foreach ( $parserOutput->getTemplates() as $ns => $templates ) { |
| 3563 | + foreach ( $templates as $dbk => $id ) { |
| 3564 | + $key = $row->tl_namespace . ':'. $row->tl_title; |
| 3565 | + $poTemplates["$ns:$dbk"] = true; |
| 3566 | + } |
3569 | 3567 | } |
3570 | 3568 | |
3571 | 3569 | # Get the diff |
3572 | | - $templates_diff = array_diff( $poTemplates, $tlTemplates ); |
| 3570 | + # Note that we simulate array_diff_key in PHP <5.0.x |
| 3571 | + $templates_diff = array_diff_key( $poTemplates, $tlTemplates ); |
3573 | 3572 | |
3574 | 3573 | if( count( $templates_diff ) > 0 ) { |
3575 | 3574 | # Whee, link updates time. |
3576 | | - $u = new LinksUpdate( $this->mTitle, $parserOutput ); |
| 3575 | + $u = new LinksUpdate( $this->mTitle, $parserOutput, false ); |
3577 | 3576 | $u->doUpdate(); |
3578 | 3577 | } |
3579 | 3578 | } |