Commit graph

121 commits

Author SHA1 Message Date
Platonides
4467d11a46 Follow up r70356.
Improve WebRequest getAcceptLang(): Add support for q=0 language and the special range "*", always return the language codes in lowercase.
2010-08-03 13:23:31 +00:00
Max Semenik
07760f5799 Follow-up to r64587:
* Use WebRequest::getAcceptLang() instead of home-brewed code (and in LanguageConverter too).
* Refactored that function to use getHeader()
2010-08-02 20:16:36 +00:00
Platonides
268bf91615 Remove the require for UtfNormal.php
From r60599, this calls $wgContLang->normalize(), not UtfNormal::cleanUp(),
2010-07-30 22:35:02 +00:00
Bryan Tong Minh
b62d5dbad7 Follow-up r70037: Move isIniSizeOverflow magic to WebRequestUpload 2010-07-27 20:54:34 +00:00
Bryan Tong Minh
546a55a79d (bug 23380) Uploaded files that are larger than allowed by PHP now show a useful error message.
Introduced a WebRequestUpload class which is a wrapper around $_FILES and contains all getUpload* and getFile* methods. This has as advantage that the upload can be passed along without $wgRequest. Also because I like objects.
2010-07-27 20:38:36 +00:00
Sam Reed
5fd23ed8b5 More unused globals 2010-07-25 17:47:41 +00:00
Roan Kattouw
a973430991 Followup to r67554: move getAcceptLang() to WebRequest for general use, per CR. 2010-06-18 18:00:54 +00:00
Jack D. Pond
eb03fbf100 (Bug 23767) - PHP warning/error when REQUEST_URI returns blank (IIS issue) 2010-06-10 19:00:07 +00:00
Alexandre Emsenhuber
5a85150d86 * Fixed documentation added in e66901
* Cleaned up a bit the doc
2010-05-28 20:20:00 +00:00
Chad Horohoe
8da9785fc9 Add getCookie(). Stuff should use this now instead of accessing $_COOKIE directly 2010-05-26 00:50:46 +00:00
Mark A. Hershberger
bd3faaeb15 * Fix a bug to keep consecutive HTTP requests from sharing results
* Update Login API
2010-04-09 05:25:40 +00:00
Chad Horohoe
fd812c83f0 Followup r62231, reduce code duplication in $request->response() 2010-02-10 10:49:17 +00:00
Mark A. Hershberger
c74fe71cd8 * new FauxResponse class to help with unit testing
* Add append() method to FileRepo classes to enable chunked uploading
* Change chunksessionkey to chunksession
* Remove echo json stuff
* Fix a multitude of bugs in my own code
* still to test: mwEmbed use of chunked upload
2010-02-10 10:36:11 +00:00
Mark A. Hershberger
dcdc0f4dc7 New tests for LanguageConverter->getPreferredVariant()
Refactor getPreferredVariant, new function getHeaderVariant()
New function (FauxRequest::setHeader()) to help with testing.
2010-01-06 03:50:59 +00:00
Mark A. Hershberger
9ef63ede49 Random eol whitespace found while treking through files.
Removing unused call to $wgContLang->getFormattedNsText() from addNewUserLogEntry()
2010-01-06 03:42:30 +00:00
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