jenkins-bot has submitted this change and it was merged.

Change subject: Per special request: eliminate $wgTitle usage.
......................................................................


Per special request: eliminate $wgTitle usage.

Now with more documentation!

Change-Id: Ie9c83c37a4616823f68f69fcdfb98c18a5db5f34
---
M CodeReviewHooks.php
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CodeReviewHooks.php b/CodeReviewHooks.php
index 10aeda6..d682cc2 100644
--- a/CodeReviewHooks.php
+++ b/CodeReviewHooks.php
@@ -102,13 +102,14 @@
         * a subpage of a repository on Special:Code.
         *
         * @param $values array
+        * @param $out OutputPage
         * @return bool
         */
-       public static function onMakeGlobalVariablesScript( &$values ) {
+       public static function onMakeGlobalVariablesScript( &$values, $out ) {
                # Bleugh, this is horrible
-               global $wgTitle;
-               if ( $wgTitle->isSpecial( 'Code' ) ) {
-                       $bits = explode( '/', $wgTitle->getText() );
+               $title = $out->getTitle();
+               if ( $title->isSpecial( 'Code' ) ) {
+                       $bits = explode( '/', $title->getText() );
                        if ( isset( $bits[1] ) ) {
                                $values['wgCodeReviewRepository'] = $bits[1];
                        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9c83c37a4616823f68f69fcdfb98c18a5db5f34
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CodeReview
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to