Commit graph

206 commits

Author SHA1 Message Date
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Platonides
1ea18dfaf2 Minor changes to Ic50d01f5 Accept-Language code.
Minor improvments to commit 894c5c1

Change-Id: I8cc63cb1ba2c3aa74ca9e225022d5be75e75ad23
2012-05-29 20:38:48 +02:00
Liangent
894c5c108d Tweak Accept-Language sorting method to respect RFC 3282.
Now in Accept-Language handling (in the language converter),
languages appearing earlier in the list are treated as more
preferred languages (variants).

Change-Id: Ic50d01f52dce1ae1f4f4e747d5f8b8399ca03b0b
2012-05-28 19:03:19 +08:00
Max Semenik
40e35d5b32 Deprecate WebRequest::escapeAppendQuery()
It is an ugly piece of UI-related code in an infrastructure class.
Its only user, MobileFrontend, is currently in process of getting rid of it.

Patchset 2: Fixed commit message

Change-Id: I62f9f707532a95be01c1ecdcb1fbfbd0c4117be6
2012-04-25 12:09:01 +04:00
Reedy
8f9563ce7b A set method doesn't need to return anything (and besides, niether does $this->base->setSessionData())
Change-Id: I1315697ee2879898b033c1dd01fecb809c4fe0dd
2012-04-07 17:21:16 +01:00
Daniel Friesen
9d83797631 Separate $wgArticlePath from $wgUsePathInfo.
- $wgUsePathInfo is now only used on servers not passing REQUEST_URI to determine if PATH_INFO should be used
- WebRequest now extracts information from REQUEST_URI even when $wgUsePathInfo is false
- HTMLForm bases it's decision on whether or not to include a hidden 'title' input on whether $wgArticlePath uses a query instead of assuming that $wgUsePathInfo was used to set the article path

Change-Id: I1b461fef88b26d045f4edd7553b59255c5e595d8
2012-03-24 03:44:08 -07:00
Benny Situ
586285e1f3 followup to -r113545 - add null for missing $default param 2012-03-10 00:31:54 +00:00
Roan Kattouw
f5f30aa959 (bug 34521) Returning to the previous page after logging in loses any array-valued parameters in the query string. This happens because WebRequest::getValues() calls getVal() which strips arrays, even though the doc comment says that no transformation is applied. Changed getValues() to call getGPCVal() instead. The only difference is that arrays are no longer stripped, so the doc comment is no longer a lie 2012-03-09 23:27:28 +00:00
Niklas Laxström
7476c290d3 Hrrrmp *grumbles* 2012-03-01 13:38:49 +00:00
Arthur Richards
1c242d9690 Added unsetVal() method as antithesis to setVal() 2012-02-29 21:56:05 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Mark A. Hershberger
2d72930472 w/s 2012-02-07 13:05:31 +00:00
Sam Reed
657ecdebfa Add @since to getIP/getRawIP
Came in r94932, soemwhere after 1.18 was branched, so is in 1.19
2012-02-06 20:20:43 +00:00
Antoine Musso
ffbb4a0ed2 FauxRequest now has empty data per default 2012-01-09 10:42:44 +00:00
Jeroen De Dauw
0b105ebf1d added missing deprecation notices 2011-12-13 19:51:03 +00:00
Daniel Friesen
8ddf933100 Followup r104676, r104688:
- Update our woefully out of date doc comment for WebRequest::getPathInfo (we haven't simply been extracting a PATH_INFO for ages)
- Make PathRouter::makeWeight protected
- Add more comments to the PathRouter code
- Add two more edge case tests to the PathRouter tests.
2011-12-09 00:28:34 +00:00
Daniel Friesen
fba28f5233 Followup r104688, reintroduce the full PathRouter code now that the bug with url encoded paths is fixed. 2011-11-30 15:12:19 +00:00
Brion Vibber
73b6bd244a Revert r104274, r104284, r104285 -- breaks special pages on non-english 2011-11-28 19:55:49 +00:00
Daniel Friesen
63e93db2d8 Implement path routing code.
- Makes extending paths with extensions simpler.
- Should fix bug 32621 by parsing paths based on pattern weight rather than pattern order.
2011-11-26 16:29:25 +00:00
Daniel Friesen
ae1d5aefbf Update img_auth.php and WebRequest code to handle non index.php scripts like img_auth.php better.
Also update img_auth.php so it's abuse of $wg variables is done in a way that doesn't let "/*" action paths clobber it's handling.
This should theoretically fix bug 32486.
2011-11-24 09:55:33 +00:00
Roan Kattouw
0a4f6dd7ac Revert r102949. Broke tests (undefined variable $_SESSION because session_start() hadn't been called) and is unnecessary because we have DerivativeRequest now 2011-11-14 09:23:58 +00:00
Roan Kattouw
eca300daff Followup r101149: make FauxRequest::__construct() use $_SESSION if the session parameter isn't given 2011-11-14 08:40:06 +00:00
Alexandre Emsenhuber
0510056e5a Fix for r101858: forgot the override those methods 2011-11-03 19:25:30 +00:00
Alexandre Emsenhuber
df4b6e4c3a Per Aaron, fix for r89405: introduced DerivativeRequest to allow to override the request parameters, but not headers, cookies and session. Updated ApiEditPage (for the bug) and ApiLogin (for future use) 2011-11-03 19:14:46 +00:00
Sam Reed
450814de00 More documentation updates 2011-10-28 18:11:47 +00:00
Sam Reed
6906724935 Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:45:13 +00:00
Platonides
6dbe098f27 It is valid (albeit silly) to specify lang;q=1.000 No more than three decimals are allowed.
(rfc2616 section 3.9: Quality Values)
The language-range may contain more than one - (section 14.4) such as x-pig-latin
(section 3.10: Language Tags)
2011-10-19 15:15:08 +00:00
Sam Reed
1c6f95fec3 Documentation
Explicit member variable definitions

Simplify some code
2011-10-18 17:27:52 +00:00
John Du Hart
58685f9fd5 Followup r95921, clearer PHPDoc and better variable names per CR 2011-09-29 20:21:32 +00:00
Sam Reed
27ec1d6377 Comment out unreachable code
Remove unreachable return false;
2011-09-21 16:34:23 +00:00
Alexandre Emsenhuber
ec9b551ca9 * Added HttpError exception as replacement for wfHttpError(); changed alls core calls to it except AjaxDispatcher.php
* Changed FeedUtils' call to it to be similar than feeds are completely disabled
* Use local context instead of global variables in Special:Userlogout
2011-09-16 18:50:13 +00:00
John Du Hart
5d7fe3069e (bug 4381) Magic quotes cleaning is not comprehensive, key strings not unescaped 2011-08-31 23:15:16 +00:00
Sam Reed
3e928b4d33 Tidy up w/c
Remove trailing whitespace, add some documentation
2011-08-31 14:47:08 +00:00
Roan Kattouw
f174bb0ad0 Reverse a bad decision in r93820, which added a comment to WebRequest::getFullRequestURL() saying it would return protocol-relative URLs if $wgServer is protocol-relative. This behavior makes no sense, though, and most callers expect fully qualified URLs. So make it return a fully qualified URL and update the one caller that expected the return value would be compatible with getFullURL() 2011-08-19 13:25:43 +00:00
Alexandre Emsenhuber
77a3987052 Moved wfGetIP() to WebRequest::getIP():
* Changed all calls in core to the latter
* Also marked wfGetForwardedFor() as deprecated
* Moved wfGetIP() tests to WebRequestTest
2011-08-18 20:03:30 +00:00
Sam Reed
53851419a1 Upstreaming wikia change to WebRequest
Trim trailing whitespace

Tweak documentation
2011-08-18 00:54:06 +00:00
Daniel Friesen
0139030f2b Improve the ability for extensions to participate in how MediaWiki handles url paths:
- Allow extensions to hook into WebRequest::getPathInfo and add to or alter the way titles are extracted from paths
- Add a $variant argument to the GetLocalURL hook; It's always had $query, but never had $variant. As a result extensions using GetLocalURL never new if getLocalURL and have the possibility of trying to change the url in cases where they shouldn't and as a result breaking links on wiki with language variants.
- Add GetLocalURL::Internal hook for non-interwiki links. These kinds of links internally use a ugly hack for action=render and an extension using GetLocalURL can be buggy in render mode if they don't re-implement the same ugly hack that MW does. This ::Internal hook runs before the hack does so extension authors don't need to be exposed to our ugly hacky code.
- Add GetLocalURL::Article hook specifically for url tweaks to pretty urls (ie: Only when we would apply $wgArticlePath); This hook avoids the need for extensions that only want to tweak pretty url output. This hook avoids the need to make a bunch of tests for things like !$title->isExternal(), $query == '', and $variant === false which getLocalURL does and could potentially change in the future making wider GetLocalURL hooks change in function requiring extension updates.
2011-08-12 19:23:43 +00:00
Roan Kattouw
6adb2e86a5 Some random URL protocol forcing for protocol-relative URLs 2011-08-03 12:58:21 +00:00
Roan Kattouw
e2b9cc8899 (bug NNNNN) Rewrite most of wfExpandUrl() to handle protocol-relative URLs properly and more flexibly
* Fix a bug in rNNNNN where URLs like '/wiki/Foo' weren't expanded completely if $wgServer was protocol-relative. This caused bug NNNNN.
* Add an optional second parameter to wfExpandUrl(), which takes one the PROT_* constants. This allows the caller to determine which protocol should be used if the given URL is protocol-relative, or the given URL is domain-relative but $wgServer is protocol-relative. The options are PROT_HTTP (use http), PROT_HTTPS (use https), PROT_RELATIVE (keep the URL as protocol-relative), and PROT_CURRENT (use http if the current request is http, or https if the current request is https; this is the default).
* Factor the protocol/port detection part of WebRequest::detectServer() out into detectProtocolAndStdPort(), and add detectProtocol() as a wrapper. The latter is used by wfExpandUrl() in PROT_CURRENT mode.
* Rewrite the test suite to test all possible combinations of $wgServer, $defaultProto, $url and HTTP/HTTPS mode. This means the test suite now has 120 test cases rather than 4.
2011-07-27 08:21:40 +00:00
Aaron Schulz
b1193eec5f * Broke long Wiki.php lines
* Added getValueNames() function to WebRequest.php
2011-07-13 18:05:44 +00:00
Sam Reed
6102b8fab8 More return documentation and trimming trailing whitespace 2011-06-30 02:59:43 +00:00
Brion Vibber
f569ab1005 Tweak doc comments on WebRequest::getRequestURL() & WebRequest::getFullRequestURL() per in-person discussion with preilly; the docs were unclear as to whether the query string is included (it is). 2011-06-29 23:35:05 +00:00
Sam Reed
8bfd19b451 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (3/3), so hopefully reviewable in CR...
2011-06-17 16:05:35 +00:00
Tim Starling
b4311ca022 Fixes for r90105, r90193:
* Actually removed $wgProto.
* Per Aryeh's suggestions on the future of $wgServer: made $wgServer detection in DefaultSettings.php more permanent by merging it with the new code from r90105. This means that bug 14977 is properly fixed now. 
* Require entry points to set up the autoloader before including DefaultSettings.php. Comments on bug 14977 indicate that at some point in the past, this may have broken something. Anything that breaks now should just be fixed, we need the autoloader. Tested the most common entry points.
* Since the detection code has moved from Installer to WebRequest, I also moved the relevant test file and updated the test. The function under test is now public static, so r90154 is superseded.
2011-06-16 05:52:16 +00:00
Tim Starling
d9c41a6819 Fixed typo in comment. 2011-06-10 11:32:28 +00:00
Tim Starling
f3f1fcdc2c * Added a REQUEST_URI check to the bug 28235 handling.
* Moved most of the bug 28235 code out to a separate library class, since I was running out of distinct function names. 
* Merged the QUERY_STRING and PATH_INFO security checks, since they are dealing with the exact same problem. Removed WebRequest::isQueryStringBad(). 
* Deal with img_auth.php by having it specify what extension it expects to be streaming out. This extension can then be compared with the extension that IE might detect.
2011-06-06 11:59:20 +00:00
Platonides
923f44359b Follow up r60599. Make normalizeUnicode() work even if $wgContLang is still not set,
just as it did before (eg. getGPCVal() check). This allows for early calls before
MediaWiki is completely initialised.
2011-06-04 21:19:07 +00:00