Commit graph

206 commits

Author SHA1 Message Date
Tim Starling
ad19c032b0 Fix for bug 9413 and the related Malayalam issue reported on wikitech-l.
* Added $wgFixArchaicUnicode, which, if enabled, converts some deprecated Unicode sequences in Arabic and Malayalam text to their Unicode 5.1 equivalents.
* Added generateNormalizerData.php to generate the relevant data files. Added the generated data files also. 
* Made most things call the new wrapper method $wgContLang->normalize() instead of UtfNormal::cleanUp(), so that Unicode normalization can be customised on a per-language basis.
* Added some generic support for conversion tables to Language so that subclasses can easily implement these kinds of transformations.
2010-01-04 08:28:50 +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
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Brion Vibber
77f1f0ace7 No need to store the value of the magic quotes check here; just use a local var for clarity. 2009-08-21 21:26:34 +00:00
Tim Starling
07efbeb8ae * Fixed XSS vulnerability introduced by r49833. Only pre-release versions of MediaWiki were affected.
* Refactored the IE script entry point security check into WebRequest::isPathInfoBad(). Use the standard CGI variable PATH_INFO to do this check instead of the various potential non-standard solutions. Made the check fairly permissive to avoid a repeat of bug 13049 due to broken CGI setups especially with cgi.fix_pathinfo=0. This should theoretically be very portable and secure, but I have not tested it widely.
* Removed Chris Wrinn from the credits since his patch was wrong and has been removed.
* Made the error message more informative.
2009-08-17 13:23:45 +00:00
Chad Horohoe
9216c191fe Make $headers protected and declare it as an empty array. 2009-07-25 00:27:56 +00:00
Chad Horohoe
4efd3ebcb9 ; 2009-07-25 00:17:21 +00:00
Chad Horohoe
3c75052ece Forgot to declare $mFixMagicQuotes. 2009-07-25 00:16:00 +00:00
Chad Horohoe
5fc67a1613 Declare visibility on almost all of these, minor code style tweaks. 2009-07-25 00:14:34 +00:00
Niklas Laxström
837a3e1988 PHP is so nice to not touch our input data ever (magic_quotes anyone?), except sometimes: http://us2.php.net/variables.external#language.variables.external.dot-in-names
Work around PHP *feature* to avoid *bugs* elsewhere.
2009-07-24 13:35:24 +00:00
Tim Starling
b45af1125c Added basic support for Wietse Venema's taint feature. Fixed a few instances of shoddy code that it turned up, no actual vulnerabilities yet. 2009-02-04 09:10:32 +00:00
Brion Vibber
d50001c4ba Revert r44817 "Delay $wgContLang unstubbing"
Maintainability alert -- creates duplicate code which could become out of sync!
2008-12-23 19:56:44 +00:00
Aaron Schulz
bae4503ec8 Delay $wgContLang unstubbing 2008-12-20 00:01:34 +00:00
Aaron Schulz
c155fd4e4a Revert r43804 'This should probably be in Response, not Request, as we're setting data, not getting it. Nothing's using it yet (fairly new), so nothing to update.'
Session id is used by client request to specify its login data from cookie, so the session data, by extensions, is like a sort of request parameter. Also, WebResponse.php seems to be used for data actually sent to the client, like requested cookies.
2008-11-21 09:55:13 +00:00
Chad Horohoe
bf244b740f This should probably be in Response, not Request, as we're setting data, not getting it. Nothing's using it yet (fairly new), so nothing to update. 2008-11-21 09:01:26 +00:00
Tim Starling
2b4c3cd654 * Rewrote wfArrayMerge() in terms of array plus
* Two callers of wfArrayMerge() were bugs, both assuming strange and complex behaviour in wfArrayMerge() which has never been present or documented.
* Introduced wfMergeErrorArrays() to remove duplicates from merged error arrays, e.g. from getUserPermissionsErrors().
* Rewrote the remaining callers of wfArrayMerge() to use array plus. It makes the code clearer, assuming the reader knows more about basic PHP operators than GlobalFunctions.php. Considering the two bugs discussed above, this seems like a fair assumption. If you don't know PHP, you shouldn't be writing MediaWiki code.
2008-11-01 23:20:25 +00:00
Chad Horohoe
acf01dd7b8 Added setVal accessor to $wgRequest->data so we don't have to access it directly. Use this in ApiEditPage. 2008-09-30 15:13:13 +00:00
Chad Horohoe
a469f0dae1 Self-revert 40530, 40531. Too many things still depend on $_GET and $_POST. Needs more cleanup before this can be put in place. 2008-09-08 13:48:07 +00:00
Chad Horohoe
40618e0c3e * Add getCookie() method to WebRequest as a wrapper for $_COOKIE. Updated all instances of $_COOKIE to use this.
* Switch from running fix_magic_quotes() on $_COOKIE and $_GET/$_POST to running it on $this->cookies and $this->data. Should keep us from interfering with other programs that might do the same (and/or trying to start up a second WebRequest object). This partially fixes bug 11558.
* Todo: Do similar things with $_SERVER/$_ENV and switch to a lazy-load style, rather than on every new WebRequest.
2008-09-06 12:38:34 +00:00
Bryan Tong Minh
51f5214937 Give 3rd parameter of FauxRequest constructor default value. 2008-09-06 11:35:09 +00:00
Bryan Tong Minh
584c5510f0 Add session accessor functions to WebRequest 2008-09-06 08:58:24 +00:00
Chad Horohoe
3064f477ff Add @ingroup definitions to these. Created new group HTTP for web-related things (cookies, headers, HTTP requests, etc). 2008-09-03 17:30:20 +00:00
Victor Vasiliev
160de68802 * Fix WebRequest.php
* Add RELEASE-NOTES for my previous commit
2008-08-02 12:39:29 +00:00
Alexandre Emsenhuber
3ad85f1a20 Fixed Doxygen warnings 2008-06-02 17:50:59 +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
Victor Vasiliev
39c665b467 * (bug 6934) Allow separated inclusions, links, redirects on whatlinkshere 2008-04-12 07:25:20 +00:00
Aryeh Gregor
8059fc875b (bug 13690) Fix PHP notice on accessing some URLs. parse_url() in some versions of PHP doesn't set the path element if it's empty, rather than actually returning it as an empty string. 2008-04-11 19:03:38 +00:00
Brion Vibber
82cd975e9e * (bug 13139, 13074) Fix request data for parameters with numeric names 2008-02-26 22:33:04 +00:00
Tim Starling
801a155961 * Relocate misplaced declaration of $_response
* Added getHeader() function
* Check function_exists('get_magic_quotes_gpc') on rumours that it will be removed in a future version of PHP
2008-02-20 04:07:26 +00:00
Aryeh Gregor
ccc9f5d836 Fix typo in comment 2008-02-12 22:12:16 +00:00
Brion Vibber
f849fa942c * (bug 7681, 11559) Cookie values no longer override GET and POST variables. 2008-02-12 22:07:16 +00:00
Brion Vibber
953a80768a Correction to r29191 -- don't break $wgArticlePath check when no $wgActionPaths. :D
Cut-n-paste error.
2008-01-02 20:48:01 +00:00
Brion Vibber
de4b7e5b75 * (bug 11428) Allow $wgScript inside $wgArticlePath when emulating PATH_INFO
Fixes 'root'-style rewrite configurations
2008-01-02 20:26:06 +00:00
Aryeh Gregor
8f74078b36 * Fix Special:Userrights logs for users with special characters in their names. Previously it was urlencoding the page name passed to the FauxRequest, which did *not* urldecode it, so the constraint was being ignored by LogReader as invalid and the whole log was being posted.
* Whitespace, __METHOD__, documentation for FauxRequest to avoid (hopefully?) a repeat bug
* Todo: look for other instances of the bug
2007-11-20 19:00:55 +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
53d02f0841 use rawurldecode instead of str_replace, from brion 2007-05-21 19:50:37 +00:00
River Tarnell
060c767933 replace + with %2B in REQUEST_URI before urldecoding the title, so that literal "+" in the title works correctly 2007-05-21 19:41:56 +00:00
Brion Vibber
d9d553fa98 Fix for regression in variant short-URLs...
Cleaned up the new URL parsing code a bit, now able to recognize both $wgActionPaths and $wgVariantArticlePath and interpolate those variables.
Moved that bit into WebRequest::interpolateTitle() function which is called after $wgContLang stub object is created, so it can be used to get the variant list.
I'm not totally happy with all this code, but it works. The variant bits generally creep me out.
2007-05-17 20:02:59 +00:00
Brion Vibber
aade61c626 Fix regression where $wgActionPaths were not respected when parsing info out of REQUEST_URI.
There may still be bugs with alternate/compatibility URLs, investigate further...
2007-05-14 13:56:26 +00:00
Tim Starling
c999082474 a couple of fixes 2007-05-12 19:25:25 +00:00
Aaron Schulz
00b3b67205 *Revert r22121, causes a lot of stuff to redirect to main page for no reason, clicking history/edit tabs results in "Editing Main Page" no matter what (Apache/2.2.3_) 2007-05-12 17:46:50 +00:00
Tim Starling
cb5aecf73e Use $_SERVER['REQUEST_URI'] instead of $_SERVER['PATH_INFO'], because Apache 2.x corrupts the latter. Idea came from http://trac.agavi.org/ticket/502 . 2007-05-12 15:44:54 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Brion Vibber
fd11a81597 * (bug 8847) Strip spurious #fragments from request URI to fix redirect loops on some server configurations 2007-03-05 18:54:27 +00:00
Brion Vibber
6038f9ed00 * Clean up session checks to better handle the case where the session was
opened during the current request. May help with some caching corner
  cases.
2007-02-05 21:42:48 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
b144fcb85d Rename constructors to __constructor 2007-01-20 13:34:31 +00:00
Brion Vibber
de72df4032 * (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is
not available, as on IIS with PHP-CGI
2007-01-16 01:45:51 +00:00
Tim Starling
9b5d018643 Experimental workaround for http://bugs.php.net/bug.php?id=31892 , will be tested shortly. 2006-10-19 00:56:57 +00:00
Tim Starling
a316d7ae9b Fix for redirect.php 2006-10-04 04:13:08 +00:00
Tim Starling
3005679b0e * Removed lots of explicit require_once statements. The autoloader should theoretically be faster, because it always uses an absolute path, eliminating the need for a search, and it is never called unnecessarily. Absolute paths are also more robust in the face of odd configurations or usage patterns. Moved a few constants around to support this, they always have to be available before the method call.
* Deleted DatabaseMysql.php, no longer necessary, database classes are autoloaded. 
* Moved wfGetMimeMagic() to MimeMagic::singleton()
* Fixed a couple of __CLASS__.'::'.__FUNCTION__ things.
2006-10-03 13:00:52 +00:00
Domas Mituzas
8974bfd94b add some abstraction for web responses, so far minimal and not that used, requires discussion, conflicts and reverts %) 2006-08-12 23:03:53 +00:00
Tim Starling
02547dac72 Removed most exit() calls from the MediaWiki core, by replacing them with either a throw or by classic error checking. OutputPage::fatalError() and similar functions are deprecated, use either OutputPage::showFatalError() to return control or throw new FatalError() to relinquish it. Backwards compatibility of all interfaces has been maintained, thus extensions should continue to work and can be ported at a later date. 2006-06-07 06:40:24 +00:00
Brion Vibber
0a26267688 Revert to r14512; domas introduced massive breakage with incomplete experimental changes. They will be recommitted when they work. :) 2006-06-01 08:19:02 +00:00
Domas Mituzas
bda0b8e104 Use AutoLoader to load classes:
* remove require_once() throughout whole code, yet left in few places
* move global functions in HttpUtils, ProxyTools, Credits to class methods
* php5 only: __autoload() now used, combined with class->file map and require()
* move initialization of $wgValidSkinNames to Skin::getSkinNames()
* few more changes that will surely break stuff.
2006-06-01 07:22:49 +00:00
Antoine Musso
7ebdb6de89 Revert to r14165 . Did too many changes, didnt even run parserTests (i am bad) 2006-05-11 22:40:38 +00:00
Antoine Musso
bc14eb8045 Replacing var keyword with private / public as we now require PHP5. 2006-05-11 19:10:41 +00:00
Ævar Arnfjörð Bjarmason
2c10e0e6ce * Fixed breakage with get[]= url paramters, supposedly... 2006-05-04 02:17:58 +00:00
Antoine Musso
69689725c1 Switching from phpdoc to doxygen (use less than 32MB of memory).
Run maintenance/mwdocgen.php to generate doc in ./docs/html/ .
2006-04-19 15:46:24 +00:00
Brion Vibber
f2c29baf9f Update the FSF's address in all these GPL stub headers 2006-04-05 07:43:17 +00:00
Brion Vibber
103be1dda1 * Further work on rev_deleted; changed to a bitfield with several data-hiding
options. Not yet ready for production use; Special:Revisiondelete is
  incomplete, and the flags are not preserved across page deletion/undeletion.
  To try it; add the 'deleterevision' permission to a privileged group.
Also split some functions from GlobalFunctions to XmlFunctions.php, added
some convenience functions for building form controls, some more Linker
conveniences for formatting various types of standard link clusters.
2006-03-16 19:04:25 +00:00
Ævar Arnfjörð Bjarmason
a26d5a49d7 * s~\t+$~~ 2006-01-07 13:31:29 +00:00
Ævar Arnfjörð Bjarmason
7bbe971aec * s~ +$~~ 2006-01-07 13:09:30 +00:00
Ævar Arnfjörð Bjarmason
d8e90514ab * Documentation: @private => @access private 2006-01-07 12:48:44 +00:00
Brion Vibber
72b8bb845f Don't disappear a parameter in a derived class just because you don't use it; that's unclean and poor practice 2005-12-05 02:20:09 +00:00
Antoine Musso
178cb1ac22 * argument passed by reference but not changed
* unused argument
2005-12-04 19:55:01 +00:00
Antoine Musso
2ca68a256d Clean up unused globals! 2005-12-04 18:27:59 +00:00
Brion Vibber
874fa5ddbf * Fix WebRequest::getRequestURL() to strip off the host bits squid prepends
Corrects self-link in Atom 1.0 feeds.
2005-11-05 10:53:21 +00:00
Niklas Laxström
5facdf5fa0 * (bug 2554) Tell users they are uploading too large file 2005-08-26 15:31:05 +00:00
Brion Vibber
af2177edfd Code cleanup: normalize case for intval(), strval(), floatval() calls. 2005-08-16 23:36:16 +00:00
Brion Vibber
753cfc1553 * Various code cleanup and HTML escaping fixlets on page history, contribs etc
* fix page history with table prefix
* fix paging on history
* switch 'earliest' and 'latest' link order to fix 'prev' and 'next'
* use null where appropriate
* switch some messages to plaintext or wikitext
2005-06-29 06:16:03 +00:00
Brion Vibber
0f8f8105a6 speling 2005-06-28 06:50:34 +00:00
Brion Vibber
7b263cc131 * Convert non-UTF-8 URL parameters even if referer is local 2005-06-27 02:04:44 +00:00
Brion Vibber
fe40fe9da8 * Replace wfMungeToUtf8 and do_html_entity_decode with a single function
that does both numeric and named chars: Sanitizer::decodeCharReferences
* Removed some obsolete UTF-8 converter functions
2005-05-31 11:54:36 +00:00
Brion Vibber
7e5a4414f4 * (bug 1933) Fix PATH_INFO usage under IIS with PHP ISAPI module 2005-04-20 10:41:52 +00:00
Ævar Arnfjörð Bjarmason
49e4a88068 \t^*$ between the comment and params for consistant formatting 2005-04-07 14:13:06 +00:00
Brion Vibber
6f5560867c Start removing the Latin-1 hacks. We're going pure UTF-8 for 1.5... 2005-03-26 22:23:48 +00:00
Brion Vibber
67c82a607a Change WebRequest::getVal() to always return a string (or null), and add getArray() method for the rare times that's what we want. 2004-12-18 11:18:56 +00:00
Jens Frank
39f1d761c9 Fixes needed to make redirect.php work with MEDIAWIKI checks,
i18n and without explicitely set include_path
2004-10-03 09:53:39 +00:00
Brion Vibber
62b3b52e39 Make FauxRequest actually work ;P 2004-09-29 08:20:55 +00:00
Zheng Zhu
c05629c010 Third batch of files modified to replace selected wgLang with wgContLang 2004-09-24 16:45:31 +00:00
Brion Vibber
e199fe8803 Move the check for legacy/UTF character conversion on incoming URLs from
Title::newFromURL into WebRequest itself. Should now work on all get params,
so essentially the full URL will be converted.

(The check is not done if the referer matches the canonical server, as before.)

Fixes problem with latin-1 typed URLs introduced by the stricter UTF-8
validation checks running before the conversion check.

One minor glitch; the canonical URL redirection no longer picks up on a
charset conversion. However it's broken anyway and doesn't pick up eg
non-canonical URLs using ?title= instead of / or other such things. Needs
to be improved...
2004-09-06 03:01:33 +00:00
Brion Vibber
50ae082d03 phpdoc tweaking 2004-09-04 08:34:51 +00:00
Brion Vibber
0e082d4454 Add some documentation comments 2004-09-04 00:12:08 +00:00
Antoine Musso
ba2afcd9fa Split files and classes in different packages for phpdocumentor. I probably changed some double quotes to single and used function foo () { shema 2004-09-03 23:00:01 +00:00
Brion Vibber
066834ea58 Normalize Unicode in uploaded filenames. In particular this is a fix for a problem with non-ascii filenames uploaded with Safari, which encodes the file with HTML character references *with combining characters decomposed*.
* Fix for http://bugzilla.wikipedia.org/show_bug.cgi?id=215
2004-09-03 07:12:46 +00:00
Brion Vibber
2406b511a6 Start cracking down on illegal titles: in UTF-8 mode reject titles which have had the 'replacement character' inserted, representing illegal UTF-8 sequences or non-legal Unicode characters.
Moved the PATH_INFO check from index.php into WebRequest; it now just shoves the param into $_REQUEST['title'].
2004-09-03 06:12:57 +00:00
Antoine Musso
90155b8a97 Changing comments layout preparing for generated documentation with Phpdocumentor 2004-09-02 23:28:24 +00:00
Brion Vibber
81e0b9d3c0 One more unicode normalization fix: don't die horribly on arrays, and get the PATH_INFO title too. 2004-09-02 08:01:13 +00:00
Brion Vibber
b687f14131 Normalize Unicode input to normalization form C. Most of the time input
is already in this form and it shouldn't take very long to verify it.
There is still optimization to be done though.

Partial fix for http://bugzilla.wikipedia.org/show_bug.cgi?id=240

Will also need to verify correct UTF-8 sequences and strip characters
that are illegal in XML.

Some input may not be going through this verification yet (eg the uploaded filenames)
2004-09-02 07:50:04 +00:00
Brion Vibber
4e3ccb6d70 Add FauxRequest class for arbitrary parameters. 2004-09-02 02:23:49 +00:00
Brion Vibber
35c74af604 Start migrating wfCheckLimits to WebRequest::getLimitOffset() 2004-08-23 02:19:02 +00:00
Antoine Musso
3d60242fb5 massive double to single quotes conversion. I have not noticed any bug after a lot of testing 2004-08-22 17:24:50 +00:00
Brion Vibber
de584eb3fb Rip out some old debugging code from when this was new. 2004-08-21 10:13:36 +00:00
Tim Starling
629601a5dc don't redirect to the canonical title if other parameters have been passed in $_GET 2004-07-25 11:49:05 +00:00
Gabriel Wicke
6af7c5ce7b After a longer phone call Erik and me agreed on working on an equivalent feature most likely based on categories that interacts better with caching. More discussion on to follow.
Removed with Erik's agreement.
2004-05-13 14:17:44 +00:00
Erik Moeller
201af52713 restore section folding 2004-05-13 12:20:59 +00:00
Gabriel Wicke
df08e4792a removed section folding 2004-05-13 11:54:19 +00:00
Erik Moeller
472272dc61 New feature:
Automatic or manual collapsing and expanding of long pages.
Pages can be collapsed automatically according to a size threshold
set in the user preferences. Pages can be collapsed manually by clicking
the "Collapse" link in the TOC.

When a page is collapsed, only the intro & TOC are displayed. The
individual TOC lines link to section views, which can be individually edited
(classic section editing).

Section editing/viewing behavior has also been improved. When a section
with subsections is viewed or edited, all subsections are also loaded.

Known issues:
- After saving a section, we return to the full article view
rather than the section view, even if we previously were in section view
mode.
- Should work with Standard and Monobook, not tested with Cologne Blue yet.
- In Monobook, no backlink to the mother article is shown during section
viewing (Gabriel, can you fix that?)
2004-05-12 13:26:36 +00:00
Tim Starling
6f150c86b0 removing now unnecessary global registration, which causes a notice on every page 2004-04-03 01:22:04 +00:00
Tim Starling
e9aa758d7a Removed dependence on register_globals from everything except the special pages. Fixed miscellaneous bugs. 2004-03-29 14:48:07 +00:00
Brion Vibber
dc8ac41724 Autodiscovery <link> for RSS feed. Added helper functions for query stuff:
appendQuery() and escapeAppendQuery() to WebRequest.
2004-03-19 08:05:36 +00:00
Brion Vibber
014093acc4 More globals and uninitialized variables fixes. Added WebRequest ($wgRequest)
object to encapsulate the handling of get/post variables:

The following grab something out of $_REQUEST. The first parameter is the
variable name and is required. The second is an optional default value:

  $wgRequest->getVal() - any type, returns NULL if no default given
  $wgRequest->getInt() - forced integer, 0 default
  $wgRequest->getText() - runs through $wgLang->recodeInput()
  $wgRequest->getBool() - return true/false
  $wgRequest->getCheck() - returns true if the var is set, even if to ""

$wgRequest strips slashes at initialization if necessary.

Also in this fine object:
  $wgRequest->wasPosted() - returns false if this wasn't a real form post,
    so we can protect against faked submissions in get urls.

There's still plenty of work to do, not everything uses the new functions
yet. To test the strict mode, do define('DEBUG_GLOBALS', 1);
2004-03-08 09:09:35 +00:00