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

Change subject: Fix WebRequest::getVal calls for instrumentation
......................................................................


Fix WebRequest::getVal calls for instrumentation

As it actually defaults to either null or (string)$default, not $default.
So therefore getVal( 'key', false ) will never return false, even if 'key' is
not set.

Change-Id: Ibe6beae9d2c4a19ff59d1035564f17373298529d
---
M WikiEditor.hooks.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php
index 308a9fa..fd5c78e 100644
--- a/WikiEditor.hooks.php
+++ b/WikiEditor.hooks.php
@@ -217,7 +217,7 @@
                if ( class_exists( 'EventLogging' ) && !$request->wasPosted() ) 
{
                        $data = array();
                        $data['editingSessionId'] = self::getEditingStatsId();
-                       if ( $request->getVal( 'section', false ) ) {
+                       if ( $request->getVal( 'section' ) ) {
                                $data['action.init.type'] = 'section';
                        } else {
                                $data['action.init.type'] = 'page';
@@ -440,7 +440,7 @@
        public static function editPageAttemptSave( EditPage $editPage ) {
                $article = $editPage->getArticle();
                $request = $article->getContext()->getRequest();
-               if ( $request->getVal( 'editingStatsId', false ) !== false ) {
+               if ( $request->getVal( 'editingStatsId' ) ) {
                        self::doEventLogging(
                                'saveAttempt',
                                $article,
@@ -461,7 +461,7 @@
        public static function editPageAttemptSaveAfter( EditPage $editPage, 
Status $status ) {
                $article = $editPage->getArticle();
                $request = $article->getContext()->getRequest();
-               if ( $request->getVal( 'editingStatsId', false ) !== false ) {
+               if ( $request->getVal( 'editingStatsId' ) ) {
                        $data = array();
                        $data['editingSessionId'] = $request->getVal( 
'editingStatsId' );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe6beae9d2c4a19ff59d1035564f17373298529d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to