Wikimedia

Fix array_key_exists() expects parameter 2 to be array, null given in Mailgun extension

The Mailgun MediaWiki extension allows a MediaWiki installation to use the mailgun service to send e-mails. However, in the current implementation, the code triggers an error: Warning: : array_key_exists() expects parameter 2 to be array, null given in /var/www/html/extensions/Mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/BatchMessage.php on line 87

While trying to get an e-mail-address sent to verify the account e-mail:

  1. Register an account on your local installation
  2. Go to Special:Preferences
  3. Change your e-mail address to a new one (it does not need to actually exist, so maybe choose a local one, like test@localhost)
  4. Go to Special:ConfirmEmail
  5. Click on the "Mail a confirmation code" button to trigger the code to send an e-mail to you

You need to install the Mailgun extension before doing that, of course.

Your task is to find a way to fix this warning being triggered. Some solutions are already posted in the linked phabricator task, it's up to you to find a suitable one :)

Task tags

  • php
  • warning

Students who completed this task

BrandonXLF

Task type

  • code Code
close

2019