jenkins-bot has submitted this change and it was merged.
Change subject: SpecialNewsletter $status variable can be undefined
......................................................................
SpecialNewsletter $status variable can be undefined
If the $status->isGood() is called without a check to
see if $status is undefined, a fatal error occurs. Patch
checks whether $status is set, and throws an exception
if $status is undefined.
Bug: T115312
Change-Id: I70a97aae2d509c4075e5345ff3146c28405fc7ab
---
M includes/specials/SpecialNewsletter.php
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Addshore: Looks good to me, approved
Glaisher: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/includes/specials/SpecialNewsletter.php
b/includes/specials/SpecialNewsletter.php
index 26a0fa4..d9072ba 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -309,7 +309,7 @@
/**
* Submit callback for subscribe form.
- *
+ * @throws Exception
* @return Status
*/
public function submitSubscribeForm() {
@@ -323,7 +323,9 @@
$status = $this->newsletter->unsubscribe( $user );
$action = 'unsubscribe';
}
-
+ if ( !isset( $status ) ) {
+ throw new Exception( "POST data corrupted or required
parameter missing from request" );
+ }
if ( $status->isGood() ) {
// @todo We could probably do this in a better way
// Add the success message if the action was successful
--
To view, visit https://gerrit.wikimedia.org/r/246458
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I70a97aae2d509c4075e5345ff3146c28405fc7ab
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: D3r1ck01 <[email protected]>
Gerrit-Reviewer: 01tonythomas <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Glaisher <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits