Commit graph

133 commits

Author SHA1 Message Date
Aaron Schulz
e18a7df8f4 Deprecate revText(), redundant 2010-02-27 22:56:48 +00:00
Mark A. Hershberger
c871b75a3e follow up r62231, r61779, r62175
* Fix up messages
* For new FileRepo::append(), use flags to determine whether to delete or not
* Add more error checking for appending
* Fix a couple of places in Revision.php and LogPage.php where DB errors were produced when comment was null
* Remove bogus checking for !$comment, etc on the DONE phase of chunked uploading
* Don't pretend to return a value when raising an exception
* Add more tests for chunked uploads
* Verify that Status::getErrorsArray() (at least where it is used in ApiUpload::execute()) returns an array that we can pass to dieUsageMessage()
* Ensure that checkWarnings(), etc work only on the complete file
2010-02-22 02:15:30 +00:00
Tim Starling
f90efc8847 Initial fix for bug 20757. Committing for test on server. 2010-02-08 07:01:46 +00:00
Alexandre Emsenhuber
79bbc9937e * Fix some doxygen warnings
* Document a bit
2010-02-07 17:03:51 +00:00
Alexandre Emsenhuber
c3ec19debc Replaced all @fixme with "@todo Fixme" since doxygen doesn't have a @fixme command 2009-12-15 21:26:58 +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
Jack Phoenix
092597b8e3 coding style tweaks 2009-10-19 11:15:51 +00:00
Aaron Schulz
ffd4b0f837 Refactored unmaintainable userCan() code by making central userCanBitfield() functions 2009-10-15 11:31:33 +00:00
Aaron Schulz
6309a1f175 Follow up r57530 elsewhere 2009-10-09 19:01:39 +00:00
Andrew Garrett
6a07296e8a Replace broken nested terneries (causing a nasty bug where all admins could view fully suppressed revisions) with clear, easy to read if/then/elseif/else structure. 2009-10-08 19:40:53 +00:00
Aaron Schulz
c2f7ea4d7b * Renamed deletedcontent to deletedtext
* Removed deletedrevision and used deletedhistory/deletedtext instead
2009-09-30 19:50:35 +00:00
Aaron Schulz
942a84716a * Split off deletedrevision (view only) right and give it to sysops
* Allow show/hide link on top revision just like history
2009-09-28 03:09:48 +00:00
Tim Starling
94b11fbee4 Fixed bug with MW 1.4 style archive rows, with ar_text set: ar_flags can be gzip. Reported by email. 2009-08-27 15:02:00 +00:00
Aryeh Gregor
54824a6744 Fix comment to note return type on error 2009-08-18 20:14:23 +00:00
Andrew Garrett
8e55d63779 Make pointlessly private newFromConds public. 2009-08-12 15:30:38 +00:00
Aaron Schulz
7d2ed15a8c (bug 19864) Removed overzealous hiding of deleted (but not suppressed) rows from log/contribs list from sysops 2009-07-30 14:08:25 +00:00
Chad Horohoe
5cb82b46eb (bug 18821) Delete unused fetchAllRevisions(), which doesn't do what it says anyway. 2009-07-15 22:51:29 +00:00
Tim Starling
bc35951c93 In Special:RevisionDelete:
* Refactored to remove massive duplication
* Removed page parameter and associated contextPage member variable, doesn't seem to do anything.
* Put ID lists into a single ids parameter and member variable instead of having one for each type.
* Fixed inappropriate call of Title::newFromUrl(), always wrong
* Don't pretend to use the return value from functions that don't return anything, this reduces readability.
* Use the table names for deleteKey/typeName values, they look more like English
* Use protected not private
* Remove requirement for log type to be specified in the target
* Use POST for RevisionDelete entry forms, to avoid URL size limits and issues with non-PATH_INFO URLs
* Don't purge all pages that use the given file
* LocalFile::purgeCache() already calls purgeHistory,() no need to do it again. But do call purgeDescription(). 
* Removed token from unhide=1 links, unnecessary
* Tokens are necessary on file streaming links, added them
* Fixed private data leakage due to incorrect use of LocalRepo::newFromArchiveName(). Non-existent placeholder file was returned which meant that $oimage->userCan(File::DELETED_FILE) was always true. Pass the archive name to tryShowFile() instead of the storage key.
* Using ls_field='oi_timestamp' is not correct, oi_timestamp refers to the timestamp of the revision in question, whereas the key that is stored is the timestamp of the previous revision (i.e. the timestamp in oi_archive_name). oi_archive_name would be more correct, although only half the field is used.

Elsewhere:
* Added missing message filehist-missing
* Fixed double asterisk in Status::getWikiText()
* Fixed escaping of the target parameter to Special:RevisionDelete from ImagePage
* Deleted FileStore.php. Deprecated in filerepo refactor except for get()/export() but somehow resurrected by RevisionDelete. Hopefully this will be the end of it. New interfaces will be added for wfStreamFile() in a later commit.
* Added convenience function File::getStorageKey(), factored out of Special:Undelete
* Added convenience function Revision::newFromArchiveRow(), factored out of Special:Undelete and Special:RevisionDelete
* Fixed notice in Special:Upload, uninitialised $pageText

FIXME: current revision can be suppressed on undeletion causing an unauthenticated unsuppress. Comments indicate this is a known issue. I fixed the parser cache pollution in this case but not the rest.
2009-06-01 11:37:06 +00:00
Tim Starling
fda50654b3 In Revision::newFromTitle(): don't do a query with WHERE rev_id='' when the page doesn't exist 2009-02-17 14:02:12 +00:00
Aaron Schulz
d169a9bc8a (Bug 15936) New page's patrol button should always be visible 2009-01-15 17:53:19 +00:00
Aaron Schulz
de2d73876a Avoid extra parent id query on rev creation; only needs to be done if the current value is null, not 0 2009-01-15 17:48:14 +00:00
Leons Petrazickis
5c7431a08e (bug 17028) Added support for IBM DB2 database. config/index.php has new interface elements that only show up if PHP has ibm_db2 module enabled. AutoLoader knows about the new DB2 classes. GlobalFunctions has a new constant for DB2 time format. Revision class fixed slightly. Also includes new PHP files containing the Database and Search API implementations for IBM DB2. 2009-01-14 22:20:15 +00:00
Brion Vibber
cfb002835d Accept 'utf8' flag in place of 'utf-8' to compensate for entries broken by bug 16841 in recompressTracked.php stuff 2008-12-30 21:43:54 +00:00
Roan Kattouw
f072eb2d95 (bug 16748) Null revisions are stored in the DB with rev_len=NULL. Patch by Paul Copperman 2008-12-21 22:35:52 +00:00
Aaron Schulz
bc6adff0c6 May as well set article ID in title 2008-12-11 01:28:37 +00:00
Aaron Schulz
e03787afd9 Make getTimestampFromId() need a title. Avoids some secondary lookups and orphans revs will be overlooked. 2008-10-30 10:04:30 +00:00
Tim Starling
f72ef5416f Fix docs 2008-10-28 14:55:42 +00:00
Aaron Schulz
9d274ccce7 Add getVisibility() 2008-10-19 05:47:23 +00:00
Tim Starling
f1a352ccf9 * Revert revert r41234 of ES-related changes. The site_stats complaint should be fixed by the transaction added in r41287.
* Fix broken recursion guard in LoadBalancer::reportConnectionError(), which was causing getConnection() to return false on the second and subsequent errors, instead of throwing an exception. Revert incorrect fix r41229/r41230.
2008-09-28 01:42:55 +00:00
Tim Starling
edda5eca4c * Make Revision::newFromTitle() get the page_latest value from the master instead of the slave
* Use inefficient replication-aware fetches only if replication is in use
* Update docs/database.txt on how to check for replication
2008-09-26 02:42:30 +00:00
Aaron Schulz
7b2aa9670f * Rename randomInsert() to insertToDefault()
* Use insertToDefault() to insert revisions (talked to brion on this)
2008-09-24 20:30:10 +00:00
Brion Vibber
c4bbaf94c0 Revert some recent ES-related changes -- they made behavior much worse when we encountered problems with site_stats updates hanging and stacking up extra open ES connections.
r41230
r41229
r41093
r41091
r41092
r41086
r41063
r40696

Also reverted r41231 which no longer applies
2008-09-24 18:09:22 +00:00
Tim Starling
7410147d02 Fixes for r41154 and r41155:
* Boolean parameters are widely accepted to reduce readability. Replaced the new boolean parameters with class constant parameters instead. 
* Re-added Revision::revText(), for backwards compatibility
* The getUser()/getUserText() changes near line 1223 of SpecialUndelete.php were incorrect, $file is an ArchivedFile not a Revision, and doesn't have any $isPublic parameters.
2008-09-24 09:44:45 +00:00
Aaron Schulz
804deee936 rev_deleted security improvements as well as fix for rawpages 2008-09-22 14:37:05 +00:00
Aaron Schulz
81e7adc6ad Remove Revision::revText() and move functionality to getText() 2008-09-22 14:24:18 +00:00
Aaron Schulz
7b61c1972a ExternalStore tweaks:
* On read, spend less time checking on dead slaves
* Add randomInsert() to ES. This does the cluster picking for us
* Make revision text use randomInsert(). On write, fails-over to other clusters as needed instead of throwing db errors
2008-09-10 12:07:56 +00:00
Tim Starling
01d95d7bae No negative caching in the revision cache -- doesn't work anyway since memcached converts false to '', and so suppresses the error message on the second hit. 2008-07-28 10:16:12 +00:00
Aryeh Gregor
680007475f Fixes for r37489:
* Don't pass $data or $flags by reference.  They're never accessed again, so it makes no sense.
* Document in hooks.txt.
The interface for this hook seems very messy.  It seems like it would be much cleaner to expose $data as $url (null if stored locally); and $flags as an array, or something like that.  If the text is gzipped, the text can be extracted from the Revision and re-gzipped if you really want to for some strange reason.
2008-07-10 18:04:32 +00:00
Aaron Schulz
f40990435c Extend RevisionInsertComplete hook (bug 14780) 2008-07-10 10:30:45 +00:00
Brion Vibber
61276a7d6a Tweak to r37385: put the timestamp format normalization on the input read (Revision::getTimestampFromId()) instead of the middle tier (Skin::lastModified()) 2008-07-09 17:41:02 +00:00
Aaron Schulz
79bf4c24ed Rename 'hiderevision' to 'suppressrevision' 2008-05-25 00:31:28 +00:00
Aaron Schulz
2e7723343b Remove shitty ass useless fucking ampersands that just make it harder to avoid fucking strict notices 2008-05-23 07:33:35 +00:00
Niklas Laxström
1b6a66bbc7 * PHP Strict Standards: Only variables should be passed by reference in <> 2008-05-23 07:20:52 +00:00
Brion Vibber
9cfd1d3f2b Clean up r35180: prettify some functions, break some long lines and odd constructions. 2008-05-22 16:47:12 +00:00
Brion Vibber
a4ffac4063 Revert r35178 and normalize User's getID() and setID() methods to prettier getId() and setId()
This doesn't accomplish anything, of course, but if you're going to run around changing them, at least make em prettier eh? :)
2008-05-22 16:39:43 +00:00
Aaron Schulz
3e36ba655e * Remove pointless newline
* It helps not to through fatal errors everywhere if not title
* Add optional $pageId param to getTimestampFromID() to avoid a secondary lookup, not that anything uses this function anyway...
2008-05-22 15:15:00 +00:00
Aaron Schulz
ae54dbbb3d *The function is User::getID() not getId() 2008-05-22 14:57:07 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Brion Vibber
beedd5c5f3 Revert r34906, r34907, r34928 -- mixing high-level data into low-level storage functions for the sole purpose of passing it off to hooks, which seems very icky to me. It feels like a hook in the wrong place is being used. 2008-05-17 15:53:58 +00:00
Aaron Schulz
21bc5be1a7 Improve efficiency of autoreviewing of edits rollbacks and merge into main function 2008-05-16 18:22:31 +00:00