Legoktm has submitted this change and it was merged.

Change subject: Don't use $wgTitle when there's valid ones on hand
......................................................................


Don't use $wgTitle when there's valid ones on hand

Change-Id: Ia35329fb9dc481bd329634e6b711318a676c761c
---
M WikiArticleFeeds_body.php
1 file changed, 3 insertions(+), 10 deletions(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved
  Jack Phoenix: Looks good to me, but someone else must approve



diff --git a/WikiArticleFeeds_body.php b/WikiArticleFeeds_body.php
index 7583058..2e36e72 100644
--- a/WikiArticleFeeds_body.php
+++ b/WikiArticleFeeds_body.php
@@ -55,20 +55,18 @@
        * @param $text Article/Output text.
        */
        static function wfAddWikiFeedHeaders( $out, $text ) {
-               global $wgTitle;
-       
                # Short-circuit if this article contains no feeds
                if ( !preg_match( '/<!-- FEED_START -->/m', $text ) ) return 
true;
 
                $rssArr = array(
                        'rel' => 'alternate',
                        'type' => 'application/rss+xml',
-                       'title' => $wgTitle->getText() . ' - RSS 2.0',
+                       'title' => $out->getTitle()->getText() . ' - RSS 2.0',
                );
                $atomArr = array(
                        'rel' => 'alternate',
                        'type' => 'application/atom+xml',
-                       'title' => $wgTitle->getText() . ' - Atom 0.3',
+                       'title' => $out->getTitle()->getText() . ' - Atom 0.3',
                );
 
                # Test for feedBurner presence
@@ -133,12 +131,7 @@
                        return true;
                }
 
-               if ( is_callable( $template, 'getSkin' ) ) {
-                       $title = $template->getSkin()->getTitle();
-               } else {
-                       global $wgTitle;
-                       $title = $wgTitle;
-               }
+               $title = $template->getSkin()->getTitle();
 
                if ( $title->getNamespace() < NS_MAIN ) {
                        return true;

-- 
To view, visit https://gerrit.wikimedia.org/r/108846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia35329fb9dc481bd329634e6b711318a676c761c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiArticleFeeds
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to