| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
|
|
|
|
|
|
| |
Some classes still needs exclude for the sniff
Change-Id: I9536c2ee84f6fb4c83cf862a152cf6b00344cb97
|
|
|
|
| |
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The variable is also read in a few other places, such as to
export the value from api.php (siteinfo) and load.php (mw.config)
but those requests don't need to be held back by this extra
logic.
Alternatively, if we really want to require this for all consumption,
we should probably let PathRouter provide the value and require
consumers to use it. E.g. services->getPathRouter->getArticlePath,
or something like that.
As easy first step, I'm moving it to PathRouter, called from
WebRequest::getPathInfo which is still called on all index.php
requests for any wiki page action in any namespace (incl Special)
when the wiki uses anything other than the default 'index.php?title='
article path.
Test Plan:
* Set '$wgArticlePath = 'bla';`
* View /mediawiki/index.php/Main_Page, and observe the fatal
error message (same as before this change).
Bug: T189966
Change-Id: Id06c2557e2addb58faeef0b6f7767a65b8de55a5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is only relevant when processing page views or when constructing
Title urls with an 'action' query. Pretty important stuff, and worth
optimising for if we had to choose, but we can defer it in this case
without slowing it down, which is better for everything else.
It also means we don't mutate configuration (beyond setting whole values
as dynamic defaults), which seems desirable, and makes the overall behaviour
easier to test. Handling absence of 'view' should be PathRouter's
responsibility, not Setup.
Bug: T189966
Change-Id: I9c1eea2dcea74be0e283eb2b175268315ced1793
|
|
|
|
| |
Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2
|
|
|
|
| |
Change-Id: I9a97325d738d09370d29d35d5254bc0dadc57ff4
|
|
|
|
|
|
|
|
|
| |
We can use the ?? syntax introduced with PHP 7.0 because it is already
supported by HHVM, even when HHVM is set to be compatible with PHP 5.6.
This was inspired by Ib117e05.
Change-Id: If980839fe6f86f2b4e86bbe99905a796e4708c7c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the request URL was not normalized, for example having a double slash
in it, this could cause it to fail to match in the PathRouter. But the
canonicalizing redirect was using the normalized URL, causing a redirect
loop exception.
So:
* If the PathRouter fails to match with the original URL, try matching
against the normalized URL. This allows it to still work for
normalized URLs with a double slash in the title part of the path.
* Have WebRequest::getFullRequestURL() always return the URL without
removing dot segments or interpreting double slashes. Just append
the path to the server.
* Make MediaWikiTest.php use WebRequest instead of FauxRequest, allowing
it to reproduce the exception in question. Add relevant test.
* Add tests for the new PathRouter behaviour.
Bug: T100782
Change-Id: Ic0f3a0060904abc364f75dae920480b81175d52f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In PHP 5.3+ it's simpler to use closures rather than a replacer class to
pass parameters through to the preg_replace_callback() callback.
Remove without deprecation internal class PathRouterPatternReplacer,
unused in core and Gerrit-hosted extensions.
The new implementation is very similar, except that I renamed some
variables for clarity.
Also fixed an incorrect doc comment parameter type.
Change-Id: I4cd3c0162acdb02d51ab5b7f03b0a16e0a818d99
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.
Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.
This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.
Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
|
|
|
|
| |
Change-Id: Ib0eea494e2065c7ab356dc45fd174544a9c1c942
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|
|
|
|
|
|
|
|
| |
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I0056b4a8df243cfc0c5f25378de48f7a35170aca
|
|
|
|
| |
Change-Id: Ib8021c721e7438163d65ddf6b83ecee8fc1639c6
|
|
|
|
|
|
|
| |
Added spaces before if, foreach
Added some braces for one line statements
Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
|
|
|
|
|
|
|
|
|
|
|
| |
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
|
|
|
|
| |
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
|
|
|
|
|
|
| |
Also made file/class documentation more consistent.
Change-Id: Ia45d0756cd84138da267bf1cbd1a58be7f28c6d1
|
|
|
|
|
|
| |
Explicitly define member variable
Change-Id: Iae2cffbb299d587d9a48b3b3255a0b49501cabac
|
|
|
|
| |
Change-Id: Ibaaa2e82777178d8b25a19c4bec7aaed0239a277
|
|
|
|
|
|
|
|
|
| |
- Update the tests to test extra characters and patterns like like \\ and $1
- Also update the tests to make sure that matches that don't have enough data to work fail
- Replace the str_replace and preg_match based code with code based on preg_replace_callback.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/112313
|
|
|
|
|
|
|
|
|
| |
bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/111052
|
|
|
|
|
|
|
|
|
|
| |
- 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.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/105629
|
|
|
|
|
|
|
|
|
| |
* Removed a bit of cruft in from a comment (c&p error)
* Clarified 'value' params comment (AFAIK)
* Broke some long lines and made some other w/s cleanups
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/105510
|
|
|
|
|
|
|
|
|
|
| |
path contents.
Also add /u just for sanity sake.
Add new tests for url encoding, unicode, and length edge cases.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/104688
|
|
|
|
|
|
|
| |
WebRequest.php and hooks.txt code so we can start to add tests and fix the bug in it.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/104676
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/104474
|
|
|
|
| |
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/104285
|
|
- Makes extending paths with extensions simpler.
- Should fix bug 32621 by parsing paths based on pattern weight rather than pattern order.
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/104274
|