Commit graph

143 commits

Author SHA1 Message Date
Aaron Schulz
b7bcf1b498 * Made pageDataFromTitle protected (unused elsewhere)
* Split out selectFields() for easier use of loadPageData()
* Marked Revision::selectFields as public (was used as such)
2011-04-12 20:21:16 +00:00
Aaron Schulz
0414f53cd4 Made revText() give deprecated notice 2011-04-10 06:07:34 +00:00
Sam Reed
a59446dd48 Fixup a couple of parameter documentation bits 2011-02-11 22:06:46 +00:00
Roan Kattouw
1734fe33ce Merge r80947 from 1.16wmf4 to trunk: throw exception when text couldn't be loaded from archive table 2011-02-02 20:25:47 +00:00
Sam Reed
a54a1ee178 Fixup some more documentation 2010-11-13 00:47:51 +00:00
Aaron Schulz
7be067ecc5 Fix r44442: don't rest restriction fields 2010-11-07 18:50:35 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Chad Horohoe
e18ad044af Followup r73348, rv unrelated change 2010-09-19 23:27:16 +00:00
Chad Horohoe
7d3bd14822 Followup r70608, don't use master connection just for type check, and use getType() instead of instanceof 2010-09-19 23:25:57 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00
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