Commit graph

15 commits

Author SHA1 Message Date
Umherirrender
6a2c2548a4 Document HttpError to help taint-check
This does not help to avoid the suppression inside the class,
but it avoids the suppression for all callers

Remove unneeded local vars while looking at the code

Bug: T269895
Bug: T216348
Change-Id: I5ce9a2dddca2b3bb556eb7adb5305178db09a71a
2020-12-12 00:06:00 +01:00
Reedy
12a3883a7b Fix SingleSpaceBeforeSingleLineComment
Change-Id: I285af438ce484af40741489797f20455726ec110
2020-05-11 00:57:11 +00:00
ArtBaltai
30e54b3962 Introduce ContentHandlerFactory
Added:
- ContentHandlerFactory
Tests:
- PHPUnit
Changed
- Calls of changed and deprecated
- DI for some service/api
Deprecated:
- ContentHandler::* then similar to ContentHandlerFactory
- ContentHandler::getForTitle
- ContentHandler::$handlers

Bug: T235165
Change-Id: I59246938c7ad7b3e70e46c9e698708ef9bc672c6
2020-02-07 00:53:51 +03:00
James D. Forrester
4f2d1efdda Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
2020-01-10 09:32:25 -08:00
Thiemo Kreuz
3821a2b5b7 linkeddata: Fix broken check in PageDataRequestHandler
First I noticed a weird check that assumes that explode() would return
an integer. But it returns an array of strings. There is obviously a
count() missing.

Then I started simplifying the code:
* The count can only be 2 or 1, never anything else.
* If it is one, the first element in the array contains the original string.
* The empty string is already checked above and can never end down there.
* Finally I made the remaining `if ( … ) return true else return false` a
  straight `return …`.

Change-Id: I289144e64f449ee0875009aaa22e10a5c0eb2734
2019-04-01 11:26:48 +00:00
Derick Alangi
c6c84b2474 linkeddata: Remove unnecessary arguments and shrink if...else
if...else that returns bool can be shrinked down to a single return
statement like in this case.

Change-Id: Ic50fac1825cbdbcc052dcd470e896a9344c8e418
2019-03-27 15:20:57 +00:00
Derick Alangi
8da98dbcc2 Remove unused @throws anotation from PHPDoc comment
Change-Id: If60ad5c12edbf4ea96c5c337f0c05cf0a8d5e43d
2019-02-11 13:01:11 +01:00
Reedy
a075271157 Update composer/spdx-licenses to 1.4.0 and mediawiki/mediawiki-codesniffer to 21.0.0
https://github.com/composer/spdx-licenses/compare/1.3.0...1.4.0

Change-Id: I39f7a1310455159866bfed5224536e800befec0d
2018-07-26 17:44:28 +00:00
Fomafix
afde4611fb PageDataRequestHandler: Use getHeader() instead of getAllHeaders()
WebRequest has already the function getHeader to extract the requested
HTTP header.

Change-Id: Ifb63ce2ca8851cddf7e5e249509d60fd3620c3e7
2018-05-23 06:05:47 +00:00
Timo Tijhof
bee9f4db96 Remove various redundant '@license' tags in file headers
Redundant given this is the project-wide license already,
especially in file headers that already include the GPL license
header.

This and other minor fixups based on feedback from Ie0cea0ef5027c7e5.

* Add @file where missing.
* Move @ingroup and @deprecated from file to class doc where needed.

Change-Id: I7067abb7abee1f0c238cb2536e16192e946d8daa
2018-01-12 18:15:11 +00:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
Amir Sarabadani
e250f70742 Make Special:PageData accept two-part subpage
Bug: T163923
Change-Id: I9fc55fd1eb956871fc5dd3e104c6786d380ef445
2017-06-13 18:52:33 +04:30
Amir Sarabadani
bc74afc67e Move HttpAccept* to libs
Bug: T163923
Change-Id: I4984f6b77843669950afeff82351827cd416a80d
2017-06-12 18:28:25 +04:30
Amir Sarabadani
39088a632c Use "target" instead "title" as the param name in SpecialPageData
Using "title" confuses mediawiki and causes redirect loops

Bug: T163923
Change-Id: I29e0e6a61703cc04397205a3f7f38df5906622e1
2017-06-12 13:15:49 +00:00
Amir Sarabadani
d5bd85c5d1 Start a very basic version of Special:PageData
Bug: T163923
Change-Id: I2a1a12f20a38d8d3c50a8f6c9a363be1cb656c70
2017-06-10 04:29:37 +04:30