C. Scott Ananian has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403317 )

Change subject: Don't crash RecordLintJob if the lint info doesn't contain 
`params`
......................................................................

Don't crash RecordLintJob if the lint info doesn't contain `params`

We will crash trying to set `templateInfo` if it is present and `params`
is not.

On line 49 of RecordLintJob we're going to use `$errorInfo['params']`,
which will crash if `params` is not present.

Change-Id: I505c676cc0ccd8d54e44e65b04b10c2de03ee37c
---
M includes/ApiRecordLint.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Linter 
refs/changes/17/403317/1

diff --git a/includes/ApiRecordLint.php b/includes/ApiRecordLint.php
index 2e73282..c7e0ed4 100644
--- a/includes/ApiRecordLint.php
+++ b/includes/ApiRecordLint.php
@@ -74,6 +74,9 @@
                                continue;
                        }
                        $info['location'] = array_slice( $info['dsr'], 0, 2 );
+                       if ( !isset( $info['params'] ) ) {
+                               $info['params'] = [];
+                       }
                        if ( isset( $info['templateInfo'] ) && 
$info['templateInfo'] ) {
                                $info['params']['templateInfo'] = 
$info['templateInfo'];
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I505c676cc0ccd8d54e44e65b04b10c2de03ee37c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to