Commit graph

155 commits

Author SHA1 Message Date
Domas Mituzas
a370176b62 ProfilerSimpleText needs loading! 2008-04-20 16:17:46 +00:00
Niklas Laxström
1c20683d88 * New helper class for dealing with forms 2008-04-19 17:38:06 +00:00
Alexandre Emsenhuber
b9de0846fd * Pass directly the title object to OutputPage::returnToMain() so it doesn't need to be created there
* Added UserArrayFromResult class to AutoLoader, CentralAuth was throwing an error because it couldn't find that class
2008-04-15 16:18:08 +00:00
Tim Starling
41d4882681 In User:
* Defer load of groups data
* Introduce newFromRow()/loadFromRow() to allow bulk loading of user objects from a result set
* Hook email and email authentication save/load to allow CentralAuth to provide a global email address
* Defer save of user data after confirmEmail() and invalidateEmail(). Caller must now also call saveSettings(). This reduces the master query count in some code paths.

Elsewhere:
* Introduce UserArray class, for bulk loading of user objects. Immediately useful in email notification, potentially useful for proposed user alias feature.
* In Special:Confirmemail, remove useless handling for impossible false return from confirmEmail()/invalidateEmail().
2008-04-15 09:04:45 +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
Raimond Spekking
6d1f1f8d70 * (bug 13604) Add Special:ListGroupRights to show a list of defined usergroups and the rights for these groups.
See bug 13603 for the same function added to the API last week
Patch by Mormegil
2008-04-10 10:10:07 +00:00
Tim Starling
54e2b71bd1 * Generalised FileRepoStatus, providing a very similar general Status object.
* Fixed external storage in LBFactory_Multi, was broken
* Useful debugging hack $wgAllDBsAreLocalhost
2008-04-05 18:11:23 +00:00
Alexandre Emsenhuber
dd3136f423 Ugly hack to fix two strict standarts errors:
* Declaration of Image::newFromTitle() should be compatible with that of LocalFile::newFromTitle() : Moved Image class to Image.php, will only be loaded when an old extension need it.
* Declaration of OldLocalFile::newFromTitle() should be compatible with that of LocalFile::newFromTitle() : Added an unsed param to LocalFile::newFromTitle() with a null default value, also added the null default value to OldLocalFile::newFromTitle() but that function will throw an Exception if that value isn't modified (even if these functions should not be called by extensions).

Pass $suffix parameter to File::getArchiveRel() in File::getArchivePath()
2008-04-05 12:26:10 +00:00
Aaron Schulz
cbf29d43dd proper name 2008-04-02 17:43:57 +00:00
Aaron Schulz
d04da1d5c8 * User Pager for special:log
* Add LogEventList class. LogReader and Viewer added to the file for b/c for now.
* Add $wgLogRestrictions to restrict logs
* Show log items in watchlists
2008-04-02 05:48:16 +00:00
Tim Starling
fbfb509df5 * Introduced LBFactory -- an abstract class for configuring database load balancers and connecting to foreign DBs.
* Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. 
* Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. 
* Added ForeignDBViaLBRepo, a file repository which uses LBFactory.
* Removed $wgLoadBalancer and $wgAlternateMaster
* Improved the query group concept to allow failover and lag control
* Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each.
* Removed the $fail parameter to getConnection(), obsolete. 
* Removed the useless force() function. 
* Abstracted the replication position interface to allow for future non-MySQL support.
* Rearranged Database.php. Added a few debugging features. 
* Removed ancient benet-specific hack from waitForSlave.php
2008-03-30 09:48:15 +00:00
Roan Kattouw
a1e4f7a51c Removing ApiChangeRights module 2008-03-27 21:13:03 +00:00
Brion Vibber
2666b3c035 * (bug 13450) Email confirmation can now be canceled before the expiration
patch by MrZ-man - https://bugzilla.wikimedia.org/attachment.cgi?id=4764
Plus text strings copied back from https://bugzilla.wikimedia.org/attachment.cgi?id=4761
2008-03-25 22:03:00 +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
Raimond Spekking
fd9af62bb5 * (bug 1459) Search for duplicate files by hash: Special:FileDuplicateSearch
* Add a link on the image description page to Special:FileDuplicateSearch/filename.ext
2008-03-19 16:58:56 +00:00
Aryeh Gregor
80a5874828 This is a schema change. It's only a table creation, but the table must be created on Wikimedia servers before this revision goes live. The maintenance script populateCategory.php should be run when convenient. If it's not run, there's only one substantial case where display will be harmed: the page of a category with more than 200 net pages added since the patch goes live will give an erroneously low count. In other cases category pages will just be better-worded, and it will recognize the count in the table is bogus.
* Adds Category and CategoryList classes to represent categories themselves.
* Adds a category table, giving each category a name, ID, and counts of all members, subcats only, and files.
* Adds a maintenance script to populate the category table efficiently.  This script is careful to wait for slaves and should be safe to run on a live database.  The maintenance script's includes file is called by update.php.
* Until the category table is populated, the patch handles weird category table rows gracefully.  It detects whether they're obviously impossible, and if so, it outputs appropriate messages.
2008-03-18 00:17:28 +00:00
Victor Vasiliev
0fbdb9a27e Whoops, it's case-sensitive! 2008-03-17 15:28:52 +00:00
Victor Vasiliev
7748bcdfb0 Yes, and also I forgot autoloader 2008-03-17 15:25:03 +00:00
Aryeh Gregor
de7abbf5a3 Alphabetize 2008-03-09 02:11:06 +00:00
Roan Kattouw
e0aae6a658 API: Adding action=edit module 2008-03-03 18:08:40 +00:00
Brion Vibber
fee0f038b8 More file type checks...
* Switch XML type detection/validity check from dipping for XML processing instructions, doctypes, or subtags to just trying to parse it and checking the root element's name and namespace. This lets us properly handle SVG files which specify a namespace but no doctype, as well as rejecting files that aren't well-formed. (See http://meta.wikimedia.org/wiki/SVG_validity_checks for some samples of bad files I encountered.) Non-XML files will abort parsing pretty quickly, so this shouldn't be a big burden on other types that didn't hit a magic check.
* Fix Unicode unix script checks (er.... is that even right? :D), remove the iconv dependency
2008-02-06 01:23:12 +00:00
Tim Starling
6fb641cdfd * Added alternate preprocessor implementation "Preprocessor_Hash" which uses plain PHP hashtables for the underlying data structure. This removes the DOM dependence, avoids XML charset problems, and avoids the lack of memory accounting in DOM. It will hopefully serve as a better model for alternate language implementations than the DOM version. I haven't measured the preformance yet, but it should be comparable to Preprocessor_DOM. If the performance is good, this might be a better default than Preprocessor_DOM.
* Verified Preprocessor_Hash against Preprocessor_DOM with a differential fuzz test.
* Improved the utility of Parser_DiffTest by synchronising strip markers and allowing for loose object comparison. 
* Abstracted PPDStack to make it usable in Preprocessor_Hash.
2008-02-05 08:23:58 +00:00
Brion Vibber
7a3227596e * Merged backends for OpenSearch suggestions and AJAX search.
Both now accept namespace prefixes, handle 'Media:' and 'Special:' pages,
  and reject interwiki prefixes. PrefixSearch class centralizes this code,
  and the backend part can be overridden by the PrefixSearchBackend hook.
2008-01-30 01:07:49 +00:00
Roan Kattouw
1b691f504b (bug 12816) Adding list=random module which fetches a list of random pages. Based on a patch by Brent G. 2008-01-28 13:56:20 +00:00
Roan Kattouw
a81bd8ad8f API: Splitting of uiuser part of meta=userinfo to list=users, as discussed on the API list. 2008-01-27 20:28:36 +00:00
Roan Kattouw
d2cb8c025e No need to revert r30078: HTML-formatting the data is enough. Attacks like api.php?action=paraminfo&modules=%3Cscript%3Ealert('Owned');%3C/script%3E&format=txt don't work anymore now. 2008-01-24 13:12:03 +00:00
Brion Vibber
c0801b22f0 Revert r30078 -- formats "txt" and "dbg" dump raw unfiltered text contents into HTML output. XSS vector. 2008-01-23 23:06:10 +00:00
Roan Kattouw
262afb4b62 API: Adding txt and dbg formats, imported from query.php 2008-01-23 19:51:21 +00:00
Roan Kattouw
abaf9995ba (bug 12718) Added action=paraminfo module that provides information about API modules and their parameters 2008-01-22 21:22:04 +00:00
Tim Starling
8404b249ad Postcard from linuxland.
* Reduced stack depth by using an internal stack in expand(), and by having some common code paths (e.g. non-subst double-brace during PST) return objects which can be expanded in that internal stack instead of the PHP stack. This is friendly to xdebug but slightly slower than the original version. Also it probably helps robustness when you don't add 7 stack levels per pair of double braces.
* Profiling indicates that expand and PPD are now good targets for porting to C. Abstracted and refactored the relevant code to allow for a drop-in replacement. A factor of 2 reduction in average-case replaceVariables() time may be possible.
* Verified with preprocessorFuzzTest.php against r29950, updated to allow better PST tests.
* Made parserTests.php respect $wgParserConf
* LST and ParserFunctions need a simultaneous update with the core due to changed interfaces. DOM objects are now wrapped rather than directly exposed.
2008-01-21 16:36:08 +00:00
Roan Kattouw
bb7f8624d1 API:
* Removing action=render module (which was deprecated) in favor of action=parse
* Added prop parameter to action=parse so certain parts of the output can be left out
* action=parse&prop=text behaves pretty much exactly like action=render used to
2008-01-15 21:33:08 +00:00
Domas Mituzas
a2407ce9c8 Cleanup for Special:Randompage and Special: Randomredirect after r29725 - http://bugzilla.wikimedia.org/show_bug.cgi?id=12624
Thanks to: alex.emsenhuber
2008-01-14 12:50:20 +00:00
Victor Vasiliev
4cc099d5d1 API: add action=logout 2008-01-08 18:10:58 +00:00
Roan Kattouw
ed0a58e527 Re-adding ApiChangeRights, but commenting out its entries in ApiMain and AutoLoader. This way the module will be inaccessible for clients, but still present in SVN to be viewed and modified. 2008-01-04 22:33:22 +00:00
Brion Vibber
c04db5771d Revert r29261, r29271 for now -- some weird mixing up of functions and seemingly random array structures, and it puts back a restricted API module I'd rather not see there for now. 2008-01-04 17:35:09 +00:00
Roan Kattouw
5395945052 * Unbroke Special:Userrights for wikis without pretty URLs
** This probably shouldn't be hard-coded the way I did it
* UserrightsPage::saveUserGroups() now takes $removegroup and $addgroup parameters by reference. Parameters are changed to reflect what was actually added and removed.
* Re-adding ApiChangeRights module, which now handles permission denied errors more gracefully
2008-01-04 11:50:22 +00:00
Aryeh Gregor
c7c4617484 Various Userrights-related fixes:
* Adjust UserrightsForm so that it inherits from SpecialPage; nuke HTMLForm.  Since this breaks backward compatibility, renamed to UserrightsPage.
* Created SpecialPage::isRestricted() and enforced use of SpecialPage::userCanExecute() instead of hardcoded checks.  These can now be overridden so that more complicated restriction systems work sanely.  Used them for UserrightsPage (fixes bug 12489).
* A few random comment/documentation tweaks.
Also, update Special:Version date.
2008-01-03 23:43:24 +00:00
Brion Vibber
49e10ba5eb Remove ApiChangeRights. Duplicates code, doesn't handle current permissions model properly. 2008-01-03 23:39:21 +00:00
Brion Vibber
c9bcade8e5 Refactor some of the horror that was Special:Userrights...
Split out the remote accessors into a UserRightsProxy object, so the main interface code
doesn't have to worry about it -- it just uses the regular User object interface functions,
without caring that it's got a remote object here.
Should have cleaner behavior with numeric ID accesses as well; it now does a name lookup even for remote ones, and logs with that.
2007-12-27 02:31:58 +00:00
Victor Vasiliev
8a7c8bdec6 Introduce new autopromotion system 2007-12-23 11:38:24 +00:00
Roan Kattouw
5d8f2177c5 API:
* Add list=allcategories module
* Fix token-related E_NOTICEs
2007-12-10 15:55:12 +00:00
Victor Vasiliev
0495f90ebb Revert r28215: incorrectly moved files 2007-12-06 18:33:18 +00:00
Victor Vasiliev
4e4cdf079e Create includes/api/query for Query API and includes/api/edit for Edit API 2007-12-06 18:22:15 +00:00
Roan Kattouw
730bad3fb1 APIEDIT BRANCH MERGE: Adding apiedit modules: action={block,changerights,delete,move,protect,rollback,unblock,undelete} and list={blocks,deletedrevs}. $wgEnableWriteAPI must be explicitly set to enable these modules. 2007-12-02 14:24:07 +00:00
Victor Vasiliev
e0c20fbf7e Forgot to commit AutoLoader changes. 2007-12-01 17:06:12 +00:00
Victor Vasiliev
17cf492e6b * Introduce action=parse to API. It deprecates action=render which will be removed once (perhaps before 1.12 release). New action returns full parser output instead of returning just rendering text 2007-12-01 13:37:02 +00:00
Roan Kattouw
537f7ea5b3 API:
* Adding rvdiffformat parameter to prop=revisions
* Creating formatters for unified (UnifiedDiffFormatter) and array (ArrayDiffFormatter) diffs
2007-11-27 21:36:43 +00:00
Tim Starling
b6dba5bcfd * Refactored the parser. See my huge entry in RELEASE-NOTES for details.
* Made it possible to configure the parser class being used, via $wgParserConf.
* Moved defines from the top of Parser.php to either class constants or Defines.php
* Added Parser_DiffTest, a differential parser class for regression testing
* Added Parser_OldPP, a parser class which operates like the parser before this commit. I made one breaking change: a bugfix to avoid losing whitespace when adding MWTEMPLATESECTION markers. 
* Made internal tidy work with PHP 5
* Added the ability to supply a hook for template fetching via ParserOptions. This is handy for testing.
* Updated parserTests.txt to account for the various breaking changes I made. Removed a few parser tests that no longer test for anything useful.
2007-11-20 10:55:08 +00:00
Brion Vibber
b61adceeb9 Revert r27581, 27598, 27626
format=raw is an HTML injection machine like action=raw but without any safeguards; it's trivial to create JavaScript exploits which hit at least Internet Explorer.
There's no reason to add a whole new danger point here when you've got machine-readable structure already... please do not add this raw formatter back.
2007-11-19 15:32:06 +00:00
Victor Vasiliev
60fc9cb245 API:
* Add format=raw
* Added raw output support to ApiExpandTemplates and ApiRender
2007-11-17 16:45:59 +00:00