Commit graph

243 commits

Author SHA1 Message Date
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
Antoine Musso
dd00e0dee2 (bug 34421) avoid duplicate Subject headers
r93397 duplicated the Subject header which was passed to the mail() function
as well as to the $headers array.
2012-02-17 17:02:24 +00:00
mrbluesky
c9f492e698 (bug 32210) UserMailer.php: New edit emails should offer a single-diff link. 2012-02-10 21:47:37 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Sam Reed
5d635eb62d Bug 33880 - $wgUsersNotifiedOnAllChanges should not send e-mail to user who made the edit. 2012-01-23 15:04:22 +00:00
Mark A. Hershberger
f7ae53ce33 w/s, remove unused vars per note in bug #33537 2012-01-06 20:54:24 +00:00
Sam Reed
5bd492d51c "else if" to "elseif" 2011-11-25 00:15:27 +00:00
Sam Reed
96641da58e Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:44:47 +00:00
Sam Reed
e27527f3f1 Remove duplicate setting of From 2011-10-16 19:52:46 +00:00
Alexandre Emsenhuber
d199c452f5 * Send "undisclosed-recipients" in "To" header when sending the mail to more than one user instead of checking $wgEnotifImpersonal. This was causing Special:EmailUser to send mails with that header when $wgEnotifImpersonal is true
* Fix for r91662: Return-Path must an e-mail address and only a e-mail address, it cannot be "Name <address@...>"
* Code simplification
2011-10-16 12:39:05 +00:00
Alexandre Emsenhuber
2be3042a35 * Do magic word parsing after parameter replacement in MediaWiki:Enotif_body and MediaWiki:Enotif_subject
* Fix link to Special:EmailUser in case $wgEnotifUseRealName was true and the user defined a real name, link was pointing to Special:EmailUser/Real_Name instead of Special:EmailUser/User_Name
* Simplified the code of EmailNotification::composeCommonMailtext()
2011-10-16 09:53:41 +00:00
Alexandre Emsenhuber
ae8b7b7ad5 Fix E_WARNING from r99863 2011-10-15 19:22:05 +00:00
Chad Horohoe
215376e771 Self revert r99899....I HATE YOU PHPUNIT YOU @#Q**#(#@(#@@#(!!! 2011-10-15 19:06:31 +00:00
Chad Horohoe
9a860bef79 Temporarily reverting r99863 to see if I can pin down test failures 2011-10-15 19:02:07 +00:00