Commit graph

64 commits

Author SHA1 Message Date
jenkins-bot
995afd709d Merge "Fix code style in EmailNotification.php" 2018-10-25 19:30:22 +00:00
Alangi Derick
eb251abc62 Fix code style in EmailNotification.php
Code style fix for namespace "use" statement.

Change-Id: I0755481f640aae535c8328824812e25db467e528
2018-10-25 18:57:22 +00:00
Reedy
da9c742af0 MailAddress->toString(): Reduce complexity by inverting ifs
Change-Id: I5185c0231a0944f36d960211e78cf36273c94d52
2018-10-25 10:30:11 -07:00
Reedy
c57aacb782 Don't pass a MailAddress pass the email to mail()
Bug: T207541
Change-Id: I1516023907e9773cb093010c6b67279f695abb1a
2018-10-20 15:23:04 +00:00
Alex Monk
02b2086d95 EmailNotification: Add newline before minor edit text
Otherwise you get something like this:
"Editor's summary: interwiki fix This is a minor edit"
It's not entirely clear that the editor's summary has ended and the minor edit
text has been added by the software.

Change-Id: Iab79b5f8a1f6f319e9fd284835b7a4e86c3f0394
2018-09-29 19:08:13 +02:00
Reedy
d506c187ec Stop MailAddress accepting a User object
Bug: T204863
Change-Id: I98f110e47ec7ba3b1cd22e8d76eea4bdf7d3d155
2018-09-21 01:58:03 +00:00
Aryeh Gregor
90d4f56fe4 Mass conversion of $wgContLang to service
Brought to you by vim macros.

Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
2018-08-11 22:44:29 -06:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Chad Horohoe
ee5a9b788a Only load PEAR Smtp mailer from vendor/composer, not from pear itself
Change-Id: I91c42a3eafd079039ddbc17a11ad3c7b6579e3c1
2018-05-23 11:32:38 +00:00
Kunal Mehta
5d30435e81 mail: Refactor checks looking for PEAR libraries to be clearer
I don't think this makes any difference towards the linked bug, but
it makes it more obvious that MediaWiki doesn't try to use any PEAR
classes before attempting to require them.

Bug: T186456
Change-Id: I342f41903a15f13e72e76464499351412a9afa34
2018-04-25 22:29:13 -07:00
Alexia E. Smith
2b28a56d8a mail: Always quote uncoded names in MailAddress
Otherwise, names that contain whitespace (but no special characters
that need Q-encoding) will be sent as-is in an email header. While
that's valid by RFC 1036, RFC 5322 and others, some mail programs
fail to correctly process spaces. Avoid these problems by simply
quoting the name always - except for cases which are Q-encoded,
which must remain unquoted to be valid (and also cannot contain
spaces, thus unaffected).

Before:
> From: Foo Bar <fb@example.org>

After:
> From "Foo Bar" <fb@example.org>

Update test to work with the new criteria.

Bug: T191931
Change-Id: I4b2a0a80e8b43ecc943939fc5ebaa356a4f840e0
2018-04-24 21:29:25 +00:00
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00:00
James D. Forrester
73aeb82fab EmailNotification: Hard deprecate updateWatchlistTimestamp()
Soft-deprecated in 1.27.

Depends-On: Ie7073f2048ba2b79a8b36ad913453008ec3555ce
Change-Id: If1dd2f8211c808ab0e284d7a3fb0b24610a0b32d
2018-02-03 03:48:33 +00:00
Simeon Dahl
41acc515d4 Cleanup, removed space
Removed a space in class to follow the same style as the others.
Edit is pure cleanup.

Change-Id: I0810e2cf5929dd8ac039e6ae2eff0d7b07f14196
2017-11-02 13:54:05 +01:00
Umherirrender
ace44e2064 Use correct variable name in @param documentation
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
2017-08-11 19:27:19 +02:00
Matthew Flaschen
6e5e278494 Split minoredit into minoredit and enotif_minoredit
This allows minoredit to have links, while enotif_minoredit can
not.

Change-Id: I7aff9e5a5e6d460f6fce7da36a32e4717b247e4c
2017-07-27 20:13:58 -04:00
Kunal Mehta
d1cf48a397 build: Update mediawiki/mediawiki-codesniffer to 0.10.1
And auto-fix all errors.

The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.

Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
2017-07-22 18:24:09 -07:00
Mark A. Hershberger
6c7d4481d7 Update documentation URL
Change-Id: I6a32689c5d224674fe96ad631b073f9efba47e3f
2017-05-30 22:16:22 -04:00
jenkins-bot
aa3319c4c0 Merge "Miscellaneous indentation tweaks" 2017-02-28 18:38:36 +00:00
Bartosz Dziewoński
ecdef925bb Miscellaneous indentation tweaks
I was bored. What? Don't look at me that way.

I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.

Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
2017-02-27 19:23:54 +01:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
addshore
79e841bcf8 Add missing properties to MailAddress class
Change-Id: I6f199cee22678391938637685a1a81771528eac4
2016-12-23 15:56:51 +00:00
Brian Wolff
d2aba5a04e Escape return path extra params to php mail()
PHP only escapes some dangerous shell characters. This is a hardening
measure, as MW's sanitizeEmail routines should also have prevented
evil characters from being in mail addresses in the first place.

Bug: T152717
Change-Id: I3736d612ed40d257ee3dde8e98eb30ccf432670a
2016-12-10 13:03:21 +00:00
Fomafix
202f695f67 Update weblinks in comments from HTTP to HTTPS
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.

Also update some defect links.

Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
2016-11-07 15:24:46 +01:00
addshore
818984e5cb Remove WatchedItemStore::getDefaultInstance
Change-Id: I0c7d706fabee8d1f6fcfbc4c568f375953de8058
2016-05-06 08:47:37 +00:00
Kunal Mehta
c9d885f3b4 Namespace LinkTarget under MediaWiki\Linker
And add a GPL file header while we're at it.

Change-Id: I15a6f240124c879b21fb655ade1baaebf4f34ffd
2016-04-21 17:19:10 -07:00
Reedy
0f5e26ee41 Remove deprecated calling style of UserMailer::send()
Depends-On: I513639f706ce16334180908f55638eebf8a4de80
Depends-On: I3fce6c666e2c878a221e2e4c6acacfd0254d173a
Change-Id: I475932f37a579dd86bfd98e6b14509d6ba86f128
2016-04-02 19:02:10 +01:00
Reedy
b5656b6953 Many more function case mismatches
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
2016-03-19 00:20:58 +00:00
addshore
a683b11b23 Move EmailNotification::updateWatchlistTimestamp to WatchedItemStore
Flow is the only thing remaining that uses this deprecated method.

Change-Id: Iaa4e1e34cb3f2a91c163565fb0107c500e3852d7
2016-03-08 18:44:05 +00:00
Reedy
b06ba4991e mail: Turn UserMailer::quotedPrintableCallback into an inline closure
Change-Id: I1b11a95d47caeaf02291a5ab522b57d7570ca738
2016-02-29 23:19:35 +00:00
jenkins-bot
f9d7d3b856 Merge "Fixup contenttype stuff in UserMailer" 2016-02-25 17:12:13 +00:00
Perside Rosalie
94ef54b22f Updating docs for UserMailer::sendWithPear() which calls $mailer->send()
$mailer->send() call in UserMailer::sendWithPear() which is correct. $mailer is an
instance of Mail_smtp not UserMailer so the arguments passed to the send() method are
correct. The docs have been updated appropriately.

Bug: T68673
Change-Id: Ia85f957c60f4dafd3f450cda469b70bdcc166a8f
2016-02-25 16:50:30 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Kevin Israel
94e5b80fee Remove references to safe_mode INI setting
The feature no longer exists starting in PHP 5.4.0, and MediaWiki
now only supports PHP 5.5.9 or newer.

Change-Id: I3f2d1b564c50f0a28ec1ec0abd7d1b242e26953b
2016-02-12 19:18:26 -05:00
addshore
627a47801b Use LinkTarget in EmailNotification::updateWatchlistTimestamp
Change-Id: I3a59839b3ec4db42966afa1db5ad0252fafa8cb9
2016-02-03 16:59:45 +01:00
Aaron Schulz
5e1d0584b7 Code style cleanups to notifyOnPageChange()
Change-Id: I08593be2eba6417cdfae31b1aa1021da7db00c74
2016-01-29 16:03:29 -08:00
Aaron Schulz
334e8f8f9d Remove $wgEnotifUseJobQ
Always treat this as on and simplify the code.
This will also make it easier to move updateWatchlistTimestamp() into
the EnotifNotifyJob class to avoid query timeouts.

Change-Id: I8ceaa42cdcfe3ad00a26368be6a73052be329045
2016-01-29 12:24:16 -08:00
Reedy
d70660f2dc Fixup contenttype stuff in UserMailer
Change-Id: I9e251962fe731fa78f6867a14e2e91783288dd61
2016-01-21 01:11:53 +00:00
jenkins-bot
25d33bacb3 Merge "$wgUsersNotifiedOnAllChanges should not send mail twice" 2015-12-16 19:40:01 +00:00
saper
f415a29a15 $wgUsersNotifiedOnAllChanges should not send mail twice
Also make sure that normal watchlist functionality
works for the $wgUsersNotifiedOnAllChanges, for
example changes should marked 'bold' since last visit.

Bug: T69041
Change-Id: I7d53f07ed3dceb5b1c541091fd69beca3fb3e94f
2015-12-14 01:11:05 +00:00
Chad Horohoe
885b5b842f UserMailer: Use PHP_EOL instead of DIY
Also fixes arrayToHeaderString() to be correct when called without
the $endl parameter

Change-Id: I8b9f72500f9a055f9f2e1cfcbb276d565674f1b8
2015-11-10 17:28:32 -08:00
addshore
06b3acc333 Of course EmailNotification::updateWatchlistTimestamp returns users ids
Change-Id: I04b2a8f97527c2bcd3f993b60e4100915b7f4c18
2015-10-13 17:30:04 +01:00
Gergő Tisza
4d7e8b44fb Add UserMailerTransformX and UserMailerSplitTo hooks
UserMailerTransformContent allows extensions to change the body of
an email sent via UserMailer::send(). This is applied before
low-level transformations such as multipart or content encoding.

UserMailerTransformMessage is similar but it is run after those
transformations.

UserMailerSplitTo allows extensions to request that a certain
user should always be emailed separately (so when UserMailer::send()
is called with an array of target addresses, that user will be split
out into a separate call). This is intended for content
transformations which need to be different per user, such as
encryption.

A side effect is that while before a call to UserMailer::send() was
either fully succeeded or fully failed, now the message might be
delivered to some targets but not others. send() will return a failed
Status object in those cases.

Bug: T12453
Change-Id: I4c3a018110173c3b5d52a753fdcbec397b590ced
2015-10-06 13:31:13 -07:00
Siebrand Mazeland
6f1db0e3c9 Fix PHPCS warnings in /includes/mail/
Change-Id: Iea420ddecac86ef9a6f34b420b0cd151ba604e91
2015-09-28 13:47:16 +02:00
Kunal Mehta
4e09a3e903 Set 'List-Help' header for watchlist emails
Added an option to UserMailer::sendMail() to allow adding arbitrary
headers to emails.

Bug: T58315
Change-Id: I01a60430bf39f6bd104269b7246767f016eb9cd5
2015-08-19 09:37:45 +00:00
Bryan Davis
5421822f94 UserMailer comment cleanup
Use `//` line comment markers.

Change-Id: I327bf2de17bd5996f3bf1b8e74c55f7067df3336
2015-08-14 11:44:35 -06:00
Chad Horohoe
9cbf84879e Add PEAR's Mail and Mail_Mime to composer.json's suggestions
Bug: T97454
Change-Id: Ib9f0f5329249b504814d08638f5b7fbde091344c
2015-08-14 17:42:53 +00:00
jenkins-bot
02f609e068 Merge "Don't send email notifs to blocked users if $wgBlockDisablesLogin is true" 2015-08-13 16:44:05 +00:00
Kunal Mehta
c8ac9622ea Clean up UserMailer::send() parameters
$replyto and $contentType should now be passed as an array of $options.
This will make it easier to add more options in the future without
having a long list of optional parameters.

Change-Id: I2c38bb438bd01e0ed2552024a40311f3e8e2dc08
2015-07-20 21:34:44 -07:00