Commit graph

207 commits

Author SHA1 Message Date
Niklas Laxström
d4885e2ae8 Followup r101834 - this time tested 2011-11-03 17:09:29 +00:00
Niklas Laxström
6470c75721 Quick ugly fix to avoid duplicate log entries in rc feed.
I didn't think that save() would send lines, since there was function to do that (added in r45725 - duplicating existing code).
This part of codebase could use much TLC
2011-11-03 17:07:29 +00:00
Sam Reed
9d41b95053 Kill various unused variables
Comment some out also

Add some bits of documentation
2011-10-29 01:17:26 +00:00
Niklas Laxström
610db6c338 * (bug 30245) Use the correct way to construct a log page title 2011-09-21 09:41:40 +00:00
Niklas Laxström
e82c796570 RecentChange::notifyMove* have no callers. Everything uses ::notifyLog or ::newLogEntry. 2011-09-07 16:20:23 +00:00
Alexandre Emsenhuber
3bcd1980ff Use $this->mAttribs['rc_old_len'] and $this->mAttribs['rc_new_len'] instead of $this->mExtra['oldSize'] and $this->mExtra['newSize'] 2011-09-06 13:17:22 +00:00
Roan Kattouw
fbc65f8972 Per CR on r44412 and my promise in the commit summary of r94990, stop abusing $wgInternalServer (intended for Squid URLs) for IRC/e-mail URLs and introduce $wgCanonicalServer for these purposes instead. This revision introduces two new hooks for WMF hacks, in exchange for making the core code saner.
* Introduce $wgCanonicalServer, which should typically be a fully qualified version of $wgServer but in practice can be anything that you'd like to be used in IRC/e-mail notifs
** Default value is $wgServer, expanded to http:// if protocol-relative
** This means you can easily set HTTPS as the 'default' protocol to use in IRC and e-mail notifs by setting $wgCanonicalServer to https://example.com
* Introduce Title::getCanonicalURL(). Similar to getInternalURL(), including a hook for WMF usage (which will be needed as long as secure.wikimedia.org is used)
** Also add escapeCanonicalURL(). Due to some ridiculous accident of history, the other escapeFooURL() functions don't have a $variant parameter; I decided not to follow that bad example
* Reinstate the spirit of r44406 and r44412: instead of calling getInternalURL() (or getCanonicalURL()) and regexing the title parameter out, obtain the path to index.php using $wgCanonicalServer . $wgScript and append params to that. Sadly, we need to add a hook here to support the secure server hack for WMF, but that's the price of saner code in this case
* Introduce the {{canonicalurl:}} and {{canonicalurle:}} parser functions, which work just like {{fullurl:}} and {{fullurle:}} except that they use getCanonicalURL() instead of getFullURL()
* Use {{canonicalurl:}} in the enotif_body message, fixing bug 29993 (protocol-relative URLs appear in e-mail notifications)
2011-08-19 11:23:17 +00:00
Roan Kattouw
3b35a3d2ec Followup r94754: move protocol expansion from getIRCLine() to inside getInternalUrl(); these internal URLs should always be fully qualified. Effectively this means that if $wgServer is protocol-relative and $wgInternalServer either isn't set or is also protocol relative (but it really shouldn't be the latter!), we'll add http:// to URLs used for Squid purging and in IRC lines. If people want those to be https:// instead, they can set $wgInternalServer accordingly.
We should really, really break the connection between internal URLs used for Squid purges and URLs used for IRC, and use the latter in e-mails as well. This was briefly discussed in the CR comments on r44412 and I'll be working on that today.
2011-08-19 08:56:39 +00:00
Alexandre Emsenhuber
77a3987052 Moved wfGetIP() to WebRequest::getIP():
* Changed all calls in core to the latter
* Also marked wfGetForwardedFor() as deprecated
* Moved wfGetIP() tests to WebRequestTest
2011-08-18 20:03:30 +00:00
Roan Kattouw
4876fc43d6 (bug 30398) Expand any protocol-relative URLs to HTTP in RecentChange::getIRCLine(). This will prevent sending protocol-relative URLs to the IRC feed 2011-08-17 13:32:45 +00:00
Platonides
854c414cc1 r91784 forgot to change one instance of $wgUser to $user 2011-07-19 20:21:11 +00:00
Alexandre Emsenhuber
3bc20b28a0 Pass the User object to RecentChange::doMarkPatrolled() instead of relying on $wgUser 2011-07-09 09:17:35 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Chad Horohoe
783d4e0862 Remove @static from all over the place. That's what the static keyword is for, this being PHP5 and all 2011-04-21 00:07:09 +00:00
Sam Reed
8bd96ffafd Code comments, few braces 2011-04-11 12:47:55 +00:00
Alexandre Emsenhuber
43a798f15a Get ride of extract() calls in RecentChange::getIRCLine() 2011-03-15 18:35:32 +00:00
Happy-melon
52ffdb9d1c Documentation format 2011-01-05 23:08:13 +00:00
Tim Starling
07bb8ce5b5 Remove some of the rubbish that has been accumulating in the default LocalSettings.php for years, especially code as opposed to configuration data:
* Don't set $IP. The entry point already sets it, so there's no point. Users can still set it if they can figure out a way to do it without breaking things.
* Don't include DefaultSettings.php. Doing that is code, not configuration, and it can easily be done in WebStart/Maintenance. Some non-standard entry points in extensions may be broken by this. That's their fault for being non-standard. Backwards compatibility is preserved thanks to require_once().
* Introduce $wgInvalidateCacheOnLocalSettingsChange, which when set, causes $wgCacheEpoch to be updated in the way that it previously was in the default LocalSettings.php.
* Don't set $wgLocalInterwiki to some nonsense value (possibly including spaces and punctuation in the new installer). It should be only for actual interwiki prefixes. Since most wikis don't have them, I set this to false by default and adjusted the referring code to accept this. 
* Removed the guard for web invocation with $wgCommandLineMode set. This ancient code is redundant with modern protections in doMaintenance.php. 
* In DefaultSettings.php, fixed fold terminator placement near $wgLoadScript
* Add a web entry point guard. That's one piece of code which really is necessary.
2010-12-06 15:00:56 +00:00
Sam Reed
4a0c3d8ff5 Comment return types, some explicit class variable declaration 2010-10-09 00:01:45 +00:00
Brion Vibber
c35cabe334 Tweak tab vs spaces from r73860 2010-09-28 02:18:35 +00:00
Sam Reed
9d1e45bf42 Tweak/add some documentation as hints for some code analysis 2010-09-28 01:33:11 +00:00
Alexandre Emsenhuber
5be509b0c1 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-08 14:23:14 +00:00
Chad Horohoe
4c74490bb8 Big commit: kill almost every freeResult() call as useless 2010-08-08 12:27:48 +00:00
Niklas Laxström
48c3231e32 Apply patch from bug 24104 by John Du Hart for allowing custom port.
Also updated the function documentation while at it.
2010-06-24 06:20:11 +00:00
Alexandre Emsenhuber
c00e4572b0 * Fix some doxygen warnings
* use spaces for identation in the middle of lines instead of tabs
2010-01-21 22:01:38 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Jure Kajzer
785ad24aa7 Changed sequence names to a standard <table>_<field>_seq form.
Updated all nextSequenceValue calls with new sequence names.
OverlordQ stated he'll handle changes to Postgres scripts.
Need someone to change DB2 scripts.
2009-10-28 16:17:16 +00:00
Chad Horohoe
88bf1584a6 Revert r55459, 55467, 55469, 55518 (Page creation notification email is sent when a watched page is deleted). Breaks current setups where enotif_body is customized. Sidenote: anyone looking to do this right should redo EmailNotification::notifyOnPageChange() to just use the params array from RC, rather than tacking more crap onto this function 2009-09-11 01:04:00 +00:00
Daniel Kinzler
0234640637 adding public access methods for use by XMLRC extension. 2009-09-03 16:15:55 +00:00
Chad Horohoe
3617ab6b5c (bug 15646) Page creation notification email is sent when a watched page is deleted 2009-08-21 23:33:38 +00:00
Aaron Schulz
f741c09aa2 (bug 19214) Make sure new pages have page ID cached for getTitle() 2009-06-17 21:11:29 +00:00
Alexandre Emsenhuber
19b9a1d48d Make RecentChange::cleanupForIRC() also call Sanitizer::decodeCharReferences() to remove HTML entities left by some messages (such as colon-separator, etc.) 2009-01-25 19:00:11 +00:00
Aaron Schulz
db4b0db9d2 Added notifyRC2UDP() convenience function 2009-01-14 01:45:52 +00:00
Charles Melbye
2774c33be8 Fix a problem with a protected class method that brought up an error, and also
fixed a typo in the release notes.
2009-01-12 22:52:09 +00:00
Aaron Schulz
3dbbdca71d Just use != here 2009-01-10 22:07:12 +00:00
Aaron Schulz
6059b4d6ad Minor code style tweaks & cleanup 2009-01-09 23:18:47 +00:00
Aaron Schulz
78678afa7c Hide patrol mark if patrolling is disabled 2009-01-09 22:49:40 +00:00
Aaron Schulz
6ced476ceb Clean up log restrictions check 2009-01-09 18:38:10 +00:00
Aaron Schulz
9d9ad4dab8 Revert r45605 and generalize the ability to have logs go to UDP. 2009-01-09 18:30:47 +00:00
Aaron Schulz
97878c044f Make sure feeds reflect changes due to flaggedrevs 2009-01-09 18:05:58 +00:00
Aaron Schulz
690e741c9d Mark non-patrolled edits in feeds (bug 16604) 2009-01-09 17:47:05 +00:00
Brion Vibber
3e69f5237d Revert r44867 "Improve markpatrolled hook"
Incompatible change to existing hook (changing types of parameters passed)
2008-12-23 20:56:19 +00:00
Brion Vibber
97f77b9b1a Revert r44702, r44703, r44704 (wfInvoke and UserMailer refactor based on it) and r44715, r44721 (cleanup thereof)
As Tim notes, the weird callback setup in $wgHooks isn't really something we want to replicate or ever rely on ever again, as PHP's native callback syntax already handles things fine and is more consistent (and used extensively in the rest of MediaWiki).
May be other remaining issues with the refactor on top of bugs already discovered, but if it's going to be refactored to use callbacks it should be done using regular callbacks.
2008-12-23 18:08:43 +00:00
Aaron Schulz
c29b5243ab Improve markpatrolled hook 2008-12-21 08:49:45 +00:00
Aaron Schulz
fdcb42815d Removed redundant mExtra init 2008-12-20 07:46:45 +00:00
David McCabe
43c9235283 UserMailer bigtime refactor. Please test. 2008-12-17 07:08:16 +00:00
Brion Vibber
22697961be Reverting r44454 "(bug 14843) IRC should flag redirects with "R" like it does with bots, etc."
This doesn't work as intended; when editing existing articles, this'll pull the *previous* redirection state of the article, rather than the current state, so it's wrong whenever a page is changed into, or away from, being a redirect.
2008-12-11 18:44:51 +00:00
Chad Horohoe
87d9c352c1 (bug 14843) IRC should flag redirects with "R" like it does with bots, etc. 2008-12-11 17:42:49 +00:00
Brion Vibber
9853e055ed add debug lines for UDP output so it can be more easily tested offline 2008-12-10 18:49:16 +00:00
Ilmari Karonen
feb45a7d93 revert r44412 and part of r44406: keep the improved new page URLs, but use the old getInternalURL()/preg_replace() hack to generate them 2008-12-10 18:41:28 +00:00