Commit graph

30 commits

Author SHA1 Message Date
jenkins-bot
c6ad2554f4 Merge "Add isCurrentWikiId()/isCurrentWikiDomain()/getCurrentWikiDomain() to WikiMap" 2018-10-29 22:27:15 +00:00
Aaron Schulz
dcd0a3d534 Add isCurrentWikiId()/isCurrentWikiDomain()/getCurrentWikiDomain() to WikiMap
Use these in place of various wfWikiID() calls.

Also cleanup UserRightsProxy wiki ID variable names and removed unused
and poorly named getDBname() method.

Change-Id: Ib28889663989382d845511f8d34712b08317f60e
2018-10-29 14:53:37 -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
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
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00: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
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
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
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
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
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
Reedy
d70660f2dc Fixup contenttype stuff in UserMailer
Change-Id: I9e251962fe731fa78f6867a14e2e91783288dd61
2016-01-21 01:11:53 +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
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
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
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Kunal Mehta
b2a043f1ef Add List-Unsubscribe header to emails
Bug: T58315
Change-Id: I5fb9cc6be78338819b9766456923e59f4fdee35c
2015-05-24 00:42:17 +02:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Kunal Mehta
bf8810d6bc Split UserMailer.php into includes/mail/
Change-Id: Ic435bbdbb690028a5d34e8176522fcf4aa44fa92
2014-09-14 19:03:03 +00:00