Commit graph

106 commits

Author SHA1 Message Date
Aaron Schulz
93f97a6712 Actually color replace on the right prefixed text 2008-04-21 23:15:17 +00:00
Aaron Schulz
da45109f74 Clean this up a bit 2008-04-21 23:10:20 +00:00
Aaron Schulz
b1d16453d8 Use prefixedText(), rather than IRC clean text for replace call on comment to make blue color (bug 13662) 2008-04-21 22:59:54 +00:00
Aaron Schulz
3b59a4709c Remove old nonsensical code 2008-04-20 14:31:02 +00:00
Aaron Schulz
165cfc590a * Clean up IRC feed
* Remove some unused vars
2008-04-20 14:24:10 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Aaron Schulz
9cbc0cf53d Use new fields 2008-04-02 05:07:46 +00:00
Brion Vibber
deb2045611 * (bug 12294) Namespace class renamed to MWNamespace for PHP 5.3 compatibility
* PHP 5.3 compatibility fix for wfRunHooks() called with no parameters

An autoloaded 'Namespace' class alias is retained for compatibility with
extensions which haven't updated to the new class name... however they too
will break on PHP 5.3. Yay!
2008-03-21 23:13:34 +00:00
Aaron Schulz
0f64dac23d r32045 committed from wrong working branch. Revert and commit the one I wanted. 2008-03-16 21:02:10 +00:00
Aaron Schulz
4490d3eea8 Load extra RC fields 2008-03-16 20:59:59 +00:00
Aaron Schulz
72f6c42844 Don't allow double logging of patrol events 2008-02-25 05:58:10 +00:00
Roan Kattouw
1c2b1a23f1 Removing unused global $wgRequest; that I missed in the previous commit. 2008-01-10 13:37:01 +00:00
Roan Kattouw
4c1c04dcae Fixing the mess that was r29539:
* $wgRequest shouldn't be used in functions like Article::doEdit() that are also called by API modules
* Moving code that decides whether the edit is bot out of DB logic and into UI logic: API and UI each decide indepentently from one another
* Removing $bot==='default' behavior from RecentChange::notifyEdit() and notifyNew(): nobody uses it, and it shouldn't be used anyway; whether the edit is bot should've been decided long ago
2008-01-10 13:33:23 +00:00
Daniel Cannon
bd7eafea20 * (bug 12574) Allow bots to specify whether an edit should be marked as a bot
edit, via the parameter 'bot'. (Default: '1')

Patch by Cobi <Winbots at gmail dot com>.
2008-01-10 09:54:35 +00:00
Tim Starling
353f203ce2 WARNING! NEEDS CAREFUL DEPLOYMENT
* Bug 9213: Fixed the plainly broken user_newtalk updating and caching scheme. I tried to keep my changes roughly performance-neutral, but the update on Wikimedia should be watched carefully for performance problems.
* Made UserMailer a class, use the autoloader to load it
* General UserMailer refactoring
* If the user has email-on-newtalk enabled, send them an email for every change, not just the first one before they view the page again.
* Don't add a watchlist entry automatically on change of user talk page
2007-10-03 08:46:17 +00:00
Brion Vibber
9be2c3676a Revert r26281 for the moment. Big patch, changes several existing practices. Will want some public testing and more review before taking it to trunk. 2007-10-01 19:50:25 +00:00
Aaron Schulz
4febfc77c2 *Clean up deletion of revisions and remove some gaps
*Allow blocking of users to hide names
*Implement revision deletion for images/deleted files/deleted revs
*Log deletion set off for now
*Add 'hidden' file dir
*Dissallow merging via undelete (which was inefficient and hard to reverse)
*Use restore points and diffs to special:undelete
*Add a special page to merge pages
*Get changeslist to use tables to avoid ugly formatting
*Add logs into RC for rebuildrecentchanges.php
*Add private logs
*List private logs at specialpages
*Tweak/add some deletion and merge messages
2007-10-01 19:38:28 +00:00
Nick Jenkins
786e93fb37 Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" :
if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding
Unused global declaration:  $wgGroupPermissions --> removing 
Unused global declaration:  $wgEmailConfirmToEdit (line 301) --> removing 
Variable $id appears only once (line 1021)  --> removing 
Variable $m was used before it was defined (line 805) --> defining.
Variable $retval was used before it was defined (line 2346) --> renaming to $result
Variable $rcid appears only once (line 244 of RecentChange.php)  --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please]
Unused global declaration:  $wgCommandLineMode (line 11) --> removing
Variable $k appears only once (line 132 of ImagePage.php) --> removing.
Variable $info appears only once (line 311 of ImagePage.php)  --> removing.
Unused global declaration:  $wgTitle (line 569 of ImagePage.php) -> removing.
Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966
Variable $match was used before it was defined (line 1031 of Linker.php) --> defining.
Unused global declaration:  $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing 
Unused global declaration:  $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing 
Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo  [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?]
Unused global declaration:  $wgEnableAPI (line 739 of SpecialUpload.php) --> removing.
Unused global declaration:  $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing.
Unused global declaration:  $wgContLang (line 18 of SpecialWatchlist.php) --> removing.
Unused global declaration:  $wgRawHtml (line 269 of SpecialMovepage.php) --> removing.
The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down.
Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out.
Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage.
Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise.
Variable $m was used before it was defined (line 285 of Title.php) --> defining.
Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage.
Variable $subpage appears only once (line 1297 of Title.php) --> commenting out.
Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out.
Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing.
Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing.
Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing.
Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing.
Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing.
Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent]
Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing.
Unused global declaration:  $wgLang (line 74 of SpecialWantedpages.php) --> removing.
Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing.
Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Unused global declaration:  $wgLang (line 30 of FileDeleteForm.php) --> removing.
Unused global declaration:  $wgServer (line 30 of FileDeleteForm.php) --> removing.
2007-08-21 03:57:54 +00:00
Rob Church
aaf9612fd4 Mark static methods as such 2007-08-15 15:37:28 +00:00
Rob Church
4280f45ccc * (bug 10793) Show patrol links on all eligible diff pages
* Introduce RecentChange::newFromConds() to support the above, and a new index
* Refactored some bits
2007-08-06 03:29:40 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
River Tarnell
a6f6e04841 instead of storing every mail as a job, have a job to send enotif updates for the whole mail at once. 2007-05-11 16:42:18 +00:00
Aryeh Gregor
7125495256 (bug 9860) Fix bug caused by true == 'default' (don't you love PHP?). Thanks to Ben White/Philip.
I'm not sure how to phrase this for RELEASE-NOTES since I'm not sure what it does exactly; does it only affect extension-writers or something?  From looking at the code I can't even see how the execution path is ever even followed, except maybe from maintenance scripts.
2007-05-10 01:24:51 +00:00
Brion Vibber
9150412fe7 For now revert the rev_deleted branch merge; don't want trunk to get too far gone before changes are reviewed!
Reverted: 20511, 20510, 20507, 20474, 20461, 20460, 20457, 20448, 20446
2007-03-16 16:01:07 +00:00
Aaron Schulz
2448539ad9 *Merge in phase3_rev_deleted/includes 2007-03-14 15:50:06 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Nick Jenkins
468a8890c5 Prevent minor E_STRICT warning:
* Strict Standards: Non-static method RecentChange::newFromRow() should not be called statically in includes/SpecialRecentchanges.php on line 243.
2007-01-22 05:57:04 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Nick Jenkins
784e69d028 For the "includes/" directory:
* removing unused local vars
* removing used global declarations
* adding FIXMEs against extract() calls and lines that seem to be using uninitialized variables
* adding some array() declarations.
2007-01-12 10:03:51 +00:00
Brion Vibber
803b3c07f8 Because I just know someone's going to complain about watchlists/RC being cluttered up by 'X bytes' instead of 'X', for the moment I'm splitting this to use the new rc-change-size message, and leave it at '$1' by default (so no change from the old behavior, showing number alone).
One could stick in the labeling if one desired, or leave it blank.
2007-01-07 10:54:02 +00:00
Niklas Laxström
febd48e588 * nbytes uses {{plural}}, support it 2007-01-05 23:18:37 +00:00
Antoine Musso
5110025fd0 Fix #8330: Recentchanges counter is confusing 2007-01-04 19:12:52 +00:00
Leon Weber
483d545d09 Corrected the description... 2006-12-25 15:17:33 +00:00
Leon Weber
3e8d663fe1 * (bug 8331) Added the change size value to watchlists; therefor made
watchlists use RecentChange::newFromRow() instead of newFromCurRow()
2006-12-23 23:08:41 +00:00
Rob Church
cb8b609a39 Sort out user rights when patrolling. If a user has the "autopatrol" right, then their edits are auto-marked as patrolled. If a user *doesn't* have this right, then they can't mark their own edits as patrolled in the normal fashion. 2006-12-22 19:43:20 +00:00
Brion Vibber
8ae8e5f587 Revert r18468
Makes no sense
2006-12-20 22:04:44 +00:00
Aryeh Gregor
3d8659162d * Fix typos in new class names (thanks to BrokenArrow)
* Use <strong class="mw-plusminus-neg">, not <span class="mw-plusminus-bold">
* Add correct coloring for null edits to non-Monobook-based skins
2006-12-20 21:54:04 +00:00
Leon Weber
40b3805dbf Made the change size value on recentchanges show minuses instead of dashs. Workaround until they've fixed bug 8327. 2006-12-20 16:37:27 +00:00
Leon Weber
985ca55b8a Added missing closing bracket when the diff is below the threshold. 2006-12-16 18:56:40 +00:00
Leon Weber
c62e068b27 * Made the show change size function work on page moves, page creations, and
log entries.
* Also fixed it in the javascript recentchanges.
* Moved the value behind the page title to ensure the columns are still lined up
* Merged both sql patches into one.
* Set the default for both columns to NULL to make it work on edits before the db
  update.
2006-12-13 20:08:02 +00:00
Leon Weber
4ff0b373ac Fix to use the correct css class 2006-12-10 09:49:29 +00:00
Leon Weber
6362c4f645 Fixing a bug in my last commit to make it also work on related changes. 2006-12-09 12:28:02 +00:00
Leon Weber
7531338080 * DB schema change: added two columns (rc_old_len and rc_new_len) to the recentchanges table to store
the text lengths before and after the edit
* (bug 1085) Made Special:Recentchanges show the character difference between the changed revisions
2006-12-09 11:36:35 +00:00
Nick Jenkins
74ea267553 Prevent the following strict-standards warnings - i.e. when running with error_logging(E_ALL | E_STRICT); - which seems to disable the yucky "@" operator, as well as maxing out the pedantry of warnings. Nothing major found, just nice to be as explicit and as forward-compatible as possible.
* Strict Standards: Undefined index: switch in includes/Parser.php on line 3849
* Strict Standards: Undefined index: ref in includes/Parser.php on line 3818
* Strict Standards: Non-static method OutputPage::setEncodings() should not be called statically in index.php on line 11
* Strict Standards: Only variables should be assigned by reference in includes/Skin.php on line 888
* Strict Standards: Non-static method Title::newFromURL() should not be called statically in includes/SpecialContributions.php on line 178
* Strict Standards: Only variables should be assigned by reference in includes/GlobalFunctions.php on line 2054
* Strict Standards: Undefined index:  contributions-summary in languages/Language.php on line 764
* Strict Standards: Undefined index:  trackbackhtml in skins/MonoBook.php on line 86
* Strict Standards: Undefined index:  blockip in skins/MonoBook.php on line 204
* Strict Standards: Undefined index:  tagline in skins/MonoBook.php on line 261
* Strict Standards: Undefined index: uselang in includes/SkinTemplate.php on line 1159
* Strict Standards: Non-static method CoreParserFunctions::plural() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Undefined offset:  0 in includes/SkinTemplate.php on line 196
* Strict Standards: Undefined index:  USE INDEX in includes/Database.php on line 1015
* Strict Standards: Undefined index:  image_tests in includes/Parser.php on line 3488
* Strict Standards: Undefined offset:  0 in includes/Parser.php on line 3507
* Strict Standards: Non-static method ChangesList::newFromUser() should not be called statically in includes/SpecialWatchlist.php on line 361
* Strict Standards: Non-static method RecentChange::newFromCurRow() should not be called statically in includes/SpecialWatchlist.php on line 367
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/Exception.php on line 168
* Strict Standards: Non-static method LogPage::logName() should not be called statically in includes/SpecialContributions.php on line 325
* Strict Standards: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in maintenance/commandLine.inc on line 191
* Strict Standards: Undefined index:  meatball in languages/Language.php on line 234
* Strict Standards: rmdir(/tmp/mwParser-2108164586-images/thumb): Directory not empty in maintenance/parserTests.inc on line 605
* Cleaning out some new temp files left over by parserTests (there were one or two straggler dirs/files that would persist after the test run ended, due to new tests being added over time)
* Strict Standards: Non-static method CoreParserFunctions::special() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Declaration of ListUsersPage::preprocessResults() should be compatible with that of QueryPage::preprocessResults() in includes/SpecialListusers.php on line 38
* Strict Standards: Only variables should be passed by reference in includes/SpecialBlockip.php on line 175
* Strict Standards: Skin::include_once(skins/Standard.deps.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in includes/Skin.php on line 121
* Strict Standards: Declaration of ApiMain::getResult() should be compatible with that of ApiBase::getResult() in includes/api/ApiMain.php on line 35
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/WikiError.php on line 63
* Strict Standards: Non-static method WikiError::isError() should not be called statically in includes/SpecialImport.php on line 64
* Strict Standards: Non-static method ImportStreamSource::newFromInterwiki() should not be called statically in includes/SpecialImport.php on line 58<b
* Strict Standards: Only variables should be assigned by reference in includes/SpecialUndelete.php on line 501
* Strict Standards: Non-static method Image::newFromName() should not be called statically in thumb.php on line 56
* Strict Standards: Non-static method CoreParserFunctions::numberoffiles() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Non-static method CoreParserFunctions::statisticsFunction() should not be called statically in includes/CoreParserFunctions.php on line 139
* Strict Standards: Non-static method CoreParserFunctions::isRaw() should not be called statically in includes/CoreParserFunctions.php on line 128
* Strict Standards: Non-static method CoreParserFunctions::grammar() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Undefined offset:  1 in includes/SpecialMIMEsearch.php on line 130
* Strict Standards: Undefined index:  recentchangeslinked in skins/MonoBook.php on line 184
* Strict Standards: Declaration of DumpNotalkFilter::pass() should be compatible with that of DumpFilter::pass() in includes/Export.php on line 612
* Strict Standards: Declaration of DumpNamespaceFilter::pass() should be compatible with that of DumpFilter::pass() in includes/Export.php on line 665
* Strict Standards: Non-static method ImportStreamSource::newFromUpload() should not be called statically in includes/SpecialImport.php on line 46
* Strict Standards: Undefined offset:  5 in includes/Sanitizer.php on line 396
* Strict Standards: Undefined index:  wikidbUserName in includes/SpecialUserlogin.php on line 562
* Strict Standards: Only variables should be assigned by reference in includes/api/ApiQueryBase.php on line 95
* Strict Standards: Only variables should be assigned by reference in includes/api/ApiQueryBase.php on line 116
* Strict Standards: Only variables should be assigned by reference in includes/api/ApiQueryWatchlist.php on line 128
* Strict Standards: Undefined property:  stdClass::$rc_id in includes/api/ApiQueryBase.php on line 131
* Strict Standards: Undefined property:  stdClass::$rc_last_oldid in includes/api/ApiQueryBase.php on line 164
* Strict Standards: Undefined property:  stdClass::$rc_moved_to_ns in includes/api/ApiQueryBase.php on line 285
* Strict Standards: Undefined property:  stdClass::$rc_patrolled in includes/api/ApiQueryBase.php on line 176
* Strict Standards: Undefined index:  comment in includes/api/ApiFeedWatchlist.php on line 85
* Strict Standards: Undefined offset:  0 in includes/Skin.php on line 302
* Strict Standards: Non-static method User::SetupSession() should not be called statically in includes/SpecialUserlogin.php on line 15

... There are certain to be other things too, so this is not intended to be comprehensive, rather the above just stops most of the notifications I observed.
2006-11-29 05:45:03 +00:00
Nick Jenkins
14c53b728f Code housekeeping stuff (and barring any stuff-ups on my behalf, there should be no changes in behaviour whatsoever after this) -
* removing some unused global declarations.
* removing or commenting out or adding comments for unused local vars.
* Adding one or two local var declarations.
* Declaring $matches array passed to preg_match() / preg_match_all() as array() before using [not required, just have a slight preference for the explicitness].
* remove one or two pass-by-reference function declarations where the value is not modified.
* Adding some braces to if-else blocks.
* In Parser.php, stripstrate is now an object rather than an array as per r17820, so we no longer need ask for a reference to it (as in "$x =& $this->mStripState;"), and in fact it's probably just simpler to get rid of $x altogether.
* Moving some preg regexes from "" quoting to '' quoting to stop static analyzer whinging about bad escape sequences.

... up to "LinksUpdate.php" in the includes/ directory.
2006-11-23 08:25:56 +00:00
Tim Starling
588a83905b hook for RC events 2006-09-30 12:34:53 +00:00
Brion Vibber
f99565fbab * (bug 7305) Proper compare for bot check on RC notify, should fix overrides
that force edits by non-bot users to bot mode
2006-09-13 15:35:30 +00:00
Greg Sabino Mullane
4b6d775b37 Use NULL not empty string for rc_ip if our DB is picky. 2006-08-16 00:59:34 +00:00
Greg Sabino Mullane
a9d232c10b Use NULL instead of 0 to indicate "no page" for cases where rc_cur_id is a FK. 2006-07-23 01:13:56 +00:00
Rotem Liss
ee7ab4900e Making User::isBot deprecated, using User::isAllowed('bot') instead, making it a wrapper of User::isAllowed, and deleting several obsolete comments. 2006-07-16 16:42:15 +00:00