Commit graph

258 commits

Author SHA1 Message Date
Aaron Schulz
3cb34a96ad Removed redundant begin/commit calls
* onTransactionIdle() callbacks already run in auto-commit mode.

Change-Id: I1eab5953080fe28fe58d7a75f88612c591db6e9a
2014-06-24 18:58:49 -07:00
Siebrand Mazeland
2daa1fab7a Make phpcs-strict pass on includes/ (3/~10)
Change-Id: Ibf86d03b5479c47ee72c0dafea6777ef8178fe68
2014-05-11 19:28:07 +00:00
umherirrender
1d3dad574a $wgEnotifUseRealName: Check, if realname is non-empty
When $wgEnotifUseRealName is true and no realname is given, the email
notification will contain a empty string, so checking the realname first

Change-Id: I1b76d9eae8ada8ca2eee8fa93d7119fbff44269d
2014-05-10 14:52:02 +00:00
Federico Leva
dccbb7b402 Use an actual URL for helppage in enotif_body
The helppage can be a full URL, which canonicalurl doesn't like.

This means that if a wiki
* has a custom enotif_body which uses canonicalurl + helppage, but
* doesn't have helppage defined locally (as local/interwiki title),
then it will still have to fix either of the two locally.

Bug: 63269
Change-Id: I82d26b648ef23b69ae4fbd0a74ffa23eb7a93dae
2014-05-03 15:38:19 +02:00
jenkins-bot
00c13cb4d5 Merge "The $CHANGEDORCREATED parameter to the 'enotif_body' message will not be removed in 1.23" 2014-04-29 18:15:48 +00:00
umherirrender
23bb3d1cb4 Follow-Ups to "Fixed some @params documentation"
Fix of inline comments of the following patch sets:
Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca
Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36
Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634
Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102
Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b

Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
2014-04-23 13:39:49 +02:00
umherirrender
a3983418d5 Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I0056b4a8df243cfc0c5f25378de48f7a35170aca
2014-04-22 13:07:02 +02:00
Bartosz Dziewoński
b3352d7a9d The $CHANGEDORCREATED parameter to the 'enotif_body' message will not be removed in 1.23
It's used in 67 of our own translations and likely by end-users in
customized messages, and keeping it doesn't really hurt anything.

Per discussion on I885dc670.

Change-Id: Ia95ff4185d8f1a1e335b8c3f3d855289a66b8d3e
2014-04-17 19:13:34 +00:00
jenkins-bot
b7c06ae61d Merge "Don't use isset() to check whether an existing variable is null" 2014-03-18 11:39:20 +00:00
Alexandre Emsenhuber
c29d513deb Put the "else" (or "elseif") on the same line as the previous closing brace
Per https://www.mediawiki.org/wiki/Manual:Coding_conventions#Indenting_and_alignment

Change-Id: I208981db0a866524156bad18cb687f010afeac2c
2014-03-15 13:54:53 +01:00
Alexandre Emsenhuber
2708725a71 Don't use isset() to check whether an existing variable is null
Change-Id: I05ad172f69189cbef86c65d5990e76edbedfd7c6
2014-03-11 17:30:06 +01:00
bsitu
ee9fcbb671 Add new Hook 'SendWatchlistEmailNotification'
Bug: 53569
Change-Id: I73d5eef9a18d59b022c353c4b7d2aee18bfa6591
2014-02-25 17:04:00 -08:00
theopolisme
1768f90bc8 Deprecate $wgPasswordSenderName
The sender name for system mailings can now be configured
locally by modifying the system message "emailsender". The
new default sender name is simply "{{SITENAME}}". Added to
release notes.

Also modify UserMailer to strip CR/LF linebreaks from header
values to prevent mail header injection now that the sender
name can be modified.

Bug: 32770
Change-Id: Ibfd28cd181365c8c0b5f3e8ffe8f5de8c89844a3
2014-01-01 08:27:59 -06:00
umherirrender
0bc583af2c Move closing parenthesis from multi line if and function to own line
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.

Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
2013-12-01 21:39:00 +01:00
daniel
40f6d8546c Make sure we always restore the error handler.
Change-Id: I27f5d11ea27f783eda71c2bfdba7e70695f5d53c
2013-11-15 16:57:34 +00:00
Timo Tijhof
90749a261c doc: Remove repetitive "Give grep a chance" phrase from comments
* Follows-up b2e2b2e016.
* Minor clean up of surrounding documentation comments.
* Fixed missing keys for messages in WebInstallerPage

Change-Id: Iaa692064262f3c0e10cfa5e4b1ec8c86e5d02362
2013-08-29 10:46:46 -07:00
shirayuki
b2e2b2e016 Give grep a chance to find the usages
Change-Id: I18846326539b814fa7fa93ca54117dac3572e4b0
2013-08-16 22:07:38 +09:00
Tychay
d8b0ab4cef Merge "Mime emails should be sent with UTF-8 charset" 2013-07-15 18:37:02 +00:00
umherirrender
0a810a5a87 Avoid date()/gmdate() for date formatting
Added a MWTimestamp::format method to format a timestamp object in the
given pattern. This avoids date(), which needs the local time
zone corretly set on the server, which is assumed at the moment in
Setup.php

Added MWTimestamp::getInstance for gmdate() and
MWTimestamp::getLocalInstance for date() to create a MWTimestamp object
and use it as inline statement.
Also MWTimestamp::setTimezone and MWTimestamp::getTimzone was added for
timezone handling.

Change-Id: I812aa013be2f4380e0cf10dc465202756fe8347b
2013-07-08 04:14:12 +00:00
bsitu
f02cfb8e0c Mime emails should be sent with UTF-8 charset
Change-Id: Ifa3d14340b163ce09363c6b9956aee5c7522e6a3
2013-07-02 17:32:26 -07:00
bsitu
3e7fd9f58c Fix the error in html email when pear mail_mime is missing
When pear package mail_mime is missing, attempt to send html email throws error:
mail() expects parameter 3 to be string, array given.  This is because the code
doesn't unset the html part of the body when falling back to text email

Change-Id: Ie8c73a481cb9003a0b43893cf4751475bdf5c690
2013-06-23 18:16:28 -07:00
bsitu
f330f727df Add new hook AbortTalkPageEmailNotification
This hook will allow extension to disable the regular talk page email notification,
Echo is doing this with a hackish solution of setting global variable
wgEnotifUserTalk to false on the fly, this approach is problematic and will
be replaced with this hook

Change-Id: Ie043d9a1a771d64e4b05b7ddeca75c7542a6c575
2013-06-10 15:37:18 -07:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
umherirrender
c0d61543b2 Pass array to Title::getLocalURL instead of an urlencoded string
This makes code easier to read and the urlencode is done inside
getLocalURL or friends

Change-Id: I21b988890356d11835eedba12a90a347bf0905b2
2013-04-27 08:22:01 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
bsitu
f2282bfec9 (bug 42941) Add $CHANGEDORCREATED back for custom template
1. Add $CHANGEDORCREATED back so custom template with this variable won't break.
   Scheduled for removal in MediaWiki 1.23.
2. change escaped() to text() since this is just plain text email and client
   will interpret it as plain text

Change-Id: I7d9fd90519a68dd66f99479a7c92f6c664485a9c
2013-01-11 13:14:13 +01:00
lwelling
fc8611d286 Add support for mulitpart mime email to email sending code
The change is backwards compatible so various places that send email
can be upgraded in their own time, or ignore it.
The first user will be the Echo extension but it is likely to be used elsewhere

This requires adding 'pear install Mime_Mail' to the server install
To see a change you need to add $wgAllowHTMLEmail to your LocalSettings.php
By default it is false in DefaultSettings.php as there is no core code that uses it yet

(patch 11 notes fixed)

Change-Id: I2096f50b789ffa0b8f4fa8c32fdaf43e9b0e4661
2012-12-28 16:43:55 -05:00
lwelling
c8cbff08d8 Remove fallback for PHP installs < v5.3.2 as that is now an install requirement
The native stream_resolve_include_path can now be used exclusively

Change-Id: I891fe9e08f5257614dbc966e725c9810423108a5
2012-12-10 13:47:57 -05:00
IAlex
3b0f9bfe28 Merge "Tidy up some unbalanced returns in methods" 2012-12-09 09:48:40 +00:00
Reedy
d537d96868 Add numerous missing @throws to method documentation
Change-Id: Iba868e82a75fef7c7d011bc5be192bf059d037c0
2012-12-09 03:09:48 +00:00
Reedy
d0a242abb4 Tidy up some unbalanced returns in methods
Leave a TODO

Change-Id: Ic49ac8630650b341aafb3c17abd22f3a07805d27
2012-12-09 02:59:04 +00:00
Platonides
a1e7329d8f Use JobQueueGroup::singleton()
Replaces usages of the deprecated pop() and insert()/insertBatch()
methods of Job class.

Change-Id: I5572c9e31a14bd660d7e3b9aa7792d0be9a26103
2012-12-07 20:30:45 +01:00
bsitu
494529503b (bug 14901) Email notification mistakes log action for new page creation
Original patch by Dan Nessett, modified by Benny Situ and Roan Kattouw

Change-Id: Ibb7953741e4189127d1cd6718ac58492f254671e
2012-11-26 19:37:01 +00:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Aaron Schulz
5975deb7f4 Changed notifyOnPageChange() to use onTransactionIdle().
Change-Id: I938c771e195cae3731a29bfe55c76c997323cd2e
2012-09-24 20:33:53 -07:00
Siebrand Mazeland
01788cddd3 Replace deprecated wfMsg* calls with Message class calls.
Last round of easy replacements. About 30 uses in core remain (outside of HISTORY
and GlobalFunctions::wfMsg*). I'll work with IAlex and Nikerabbit to work towards
getting rid of those, too.

Updated method documentation in a few places.

Change-Id: I2491c006b62a9cc183230e31a0bd96c91e5b6142
2012-08-27 20:44:47 +02:00
Reedy
3f4e41a24e Noticed while looking at $wgShowUpdatedMarker related database queries, queries not using index order at all. Fixed up
Title.php at line 4313:
			array( 'wl_namespace' => $this->getNamespace(),
				'wl_title' => $this->getDBkey(),
				'wl_user' => $user->getId()
			),

In UserMailer.php at line 438:

array(
					'wl_title' => $title->getDBkey(),
					'wl_namespace' => $title->getNamespace(),
					'wl_user != ' . intval( $editor->getID() ),
					'wl_notificationtimestamp IS NULL',
				)

And line 455:

array( /* WHERE */
						'wl_title' => $title->getDBkey(),
						'wl_namespace' => $title->getNamespace(),
						'wl_user' => $watchers
					)

CREATE TABLE /*_*/watchlist (
  -- Key to user.user_id
  wl_user int unsigned NOT NULL,

  -- Key to page_namespace/page_title
  -- Note that users may watch pages which do not exist yet,
  -- or existed in the past but have been deleted.
  wl_namespace int NOT NULL default 0,
  wl_title varchar(255) binary NOT NULL default '',

  -- Timestamp when user was last sent a notification e-mail;
  -- cleared when the user visits the page.
  wl_notificationtimestamp varbinary(14)

) /*$wgDBTableOptions*/;

CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);

Change-Id: I633c009b4a1c614b966c69f042f94c2056e03784
2012-04-28 00:59:59 +01:00
Alexandre Emsenhuber
d8ef87afbf * (bug 35019) Fix for rr99942: edit summaries are no longer transformed in notification e-mails 2012-03-08 21:39:13 +00:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Antoine Musso
0ffeec1ddd (bug 34421) duplicate Subject / wrong To: headers in mail
This fixup our mail sending system which duplicated the Subject and To: header.
In some conditions it used only the email address for the From: field skipping
the username ($dest in old code only contains the email address).

Mails sent to a single recipients will look alike with mail() or PEAR Mail.
For multiple recipients:
 - php mail() will show the recipient email and 'undisclosed-recipients:'
 - PEAR Mail will only show 'undisclosed-recipients:'


Reverts r111820
Follow  r111819
Fixup    r93397
2012-02-18 15:34:12 +00:00
Antoine Musso
d8ab214e02 (bug 34421) avoid duplicate Subject headers in mail
r93397 duplicated the Subject header since it was passed both as an
argument of mail() and in the additional headers array.

This is r111765 done right.

Tested using both Pear and mail() methods.
2012-02-18 10:57:34 +00:00
Antoine Musso
9c2222010f revert r111765 bug 34421 avoid duplicate Subject headers
Was removing subjects when sending mails through PEAR.
2012-02-18 10:37:11 +00:00
Sam Reed
560ebfb721 Fix possibly undefined variables
Move $db further up

Return something on all paths
2012-02-18 01:07:42 +00:00