wiki.techinc.nl/tests
Máté Szabó f15e0a62f9 ApiQueryRevisionsBase: Fix 'rvdiffto' parameter handling on PHP 8.0
The legacy 'rvdiffto' API parameter allows consumers to supply a
revision ID or the special strings 'cur', 'prev', 'next' to
revision-related API modules. This will then be resolved to a revision
and the diff of returned revisions against this revision will be
attached to the response.

On PHP 8.0, this parameter is broken as 'cur', 'prev', 'next' no longer
get resolved to the appropriate revision ID but rather are treated as
invalid literal revision IDs. This is because given an associative array
`$params = [ 'diffto' => 'prev' ];`, the expression `$params['diffto']
!= 0` is false on PHP < 8.0 but true on PHP >= 8.0.[1]

Fix it by also checking whether the parameter value is numeric before
treating it as a revision ID, and add a test case for this logic. To
facilitate testing, convert the counter used by ApiQueryRevisionsBase to
count the number of uncached diffs served in the current response to an
instance variable; it is currently a static variable which persists
across test boundaries.

Change-Id: Ifbe14cd2880c98dddc5577d226bef5878bdd657f

---
[1] https://onlinephp.io/c/81e7b

Bug: T322335
Change-Id: Id5032932842c94f4d3ca3707fbc733f5b9704151
2022-11-03 15:49:04 +01:00
..
api-testing revision/html endpoint: Support variant conversion 2022-11-01 19:21:50 +05:30
common Reorg: Move some of request related classes to MediaWiki/Request 2022-10-28 10:15:31 +00:00
parser Merge "Followup to 02d13afa: Respect parsoid-compatible options in CLI runs" 2022-10-26 01:28:02 +00:00
phpunit ApiQueryRevisionsBase: Fix 'rvdiffto' parameter handling on PHP 8.0 2022-11-03 15:49:04 +01:00
qunit jquery.tablesorter: Convert custom cases to native QUnit.test() 2022-10-13 02:44:05 +01:00
selenium Merge "Revert "selenium: Default to larger window size"" 2022-10-25 13:30:10 +00:00
.htaccess