aboutsummaryrefslogtreecommitdiffstats
path: root/includes/logging
Commit message (Collapse)AuthorAgeFilesLines
...
* logging: Normalize "infinity" in BlockLogFormatter for pre-T241709 rowsUmherirrender2022-04-121-4/+7
| | | | | | | | This allows the API to consistently return the new value for old rows. Bug: T241709 Follow-Up: I36f49dc83718cc78f17fc340e6445030b8fd0c66 Change-Id: Ida69980f62a6ef070ba41b7e826967f424881716
* logging: Remove user_editcount from DatabaseLogEntry query infoUmherirrender2022-04-061-1/+0
| | | | | | | | The column is now unused. It was used to prefill edit count in User object before 83e1846 by use of User::newFromRow Follow-Up: I1b78bad7e1fa43f5f82908567a7daad9c6cc79b9 Change-Id: Iec5eeaa8729a3add46c11cd62dee8aefe2e5e050
* phan: Remove PhanPossiblyUndeclaredVariable suppressionUmherirrender2022-03-301-1/+3
| | | | | | | | | Make phan stricter about conditional variable declaration Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T259172 Change-Id: I1f200ac37df7448453688bf464a8250c97313e5d
* logentry: Make use getUnknownActor visible in getPerformerIdentityUmherirrender2022-03-301-1/+3
| | | | | | | | | | Move the call to ActorStore::getUnknownActor to the code which calls it. Avoid that static code analyzer see an possible undeclared actor store Found by phan (T259172) Bug: T259172 Change-Id: Ide978380726c60a35250ca67cd0adff603c971b1
* phan: Disable null_casts_as_any_type settingUmherirrender2022-03-213-0/+3
| | | | | | | | | | | Make phan stricter about null types by setting null_casts_as_any_type to false (the default in mediawiki-phan-config) Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T242536 Bug: T301991 Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
* api: Get all services for ApiPageSet in constructorUmherirrender2022-03-151-1/+0
| | | | | | | build: Removes phan suppresses due to changed parse order of phan-taint Bug: T283314 Change-Id: I616d1f8f62225210566d0ea5b9cc295fdc3e54fb
* Fix various real types related to scalar typesUmherirrender2022-03-101-1/+1
| | | | | | | | Swap null/false or use real strings if needed Found by phan strict checks Change-Id: Id82ea609f05a76c5cb8c661d5cf2b7922d6cfbc1
* Merge "Fix various documentation related to null types (part II)"jenkins-bot2022-03-091-3/+1
|\
| * Fix various documentation related to null types (part II)Umherirrender2022-03-081-3/+1
| | | | | | | | | | | | | | | | | | The functions returning null or the class property is set explict null. Some function should not accept null or return null. Found by phan strict checks Change-Id: Ie50f23249282cdb18caa332f562a3945a58d86ff
* | Merge "changetags: Fix management of a '0' tag"jenkins-bot2022-03-031-2/+2
|\ \
| * | changetags: Fix management of a '0' tagMatěj Suchánek2022-03-031-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | The tag wouldn't be treated as active, wouldn't be displayed in changes lists and it wouldn't be possible to filter it, although it was possible to create it. The changes in ::modifyDisplayQuery are needed, because ContribsPager may provide false. Add a regression test for ::formatSummaryRow. Bug: T296642 Change-Id: Iddb1e978387a0009425f6fad1821d9d15c0f5f23
* / Fix documentation about query parameter as string[]Umherirrender2022-03-031-1/+1
|/ | | | | | | | | Url query parameter sometimes contains integer, which are not allowed on string[], just use array instead. Found by phan strict checks Change-Id: I7eabe69ee7a78ffee05413a022caec940672ae9f
* Add explicit casts between scalar typesUmherirrender2022-03-011-1/+1
| | | | | | | | | | | | | | | * Some functions accept only string, cast ints and floats to string * After preg_matches or explode() casts numbers to int to do maths * Cast unix timestamps to int to do maths * Cast return values from timestamp format function to int * Cast bitwise operator to bool when needed as bool * php internal functions like floor/round/ceil documented to return float, most cases the result is used as int, added casts Found by phan strict checks Change-Id: Icb2de32107f43817acc45fe296fb77acf65c1786
* Replace some more usages of Wikimedia\(suppress|restore)Warnings()Reedy2022-02-241-2/+3
| | | | Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
* Merge "LogEventsList: Modernize warnings with log excerpts"jenkins-bot2022-02-111-10/+17
|\
| * LogEventsList: Modernize warnings with log excerptsBartosz Dziewoński2022-02-101-10/+17
| | | | | | | | | | | | Markup is changed slightly to allow using Html::warningBox(). Change-Id: I632e42ee9065b38dca443beae1cb01ef714cae7b
* | Merge "Don't double-escape the ellipses in Language::truncateForVisual()"jenkins-bot2022-02-101-3/+0
|\ \ | |/ |/|
| * Don't double-escape the ellipses in Language::truncateForVisual()C. Scott Ananian2022-02-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out this gets rid of a bunch of suppressed "SecurityCheck-DoubleEscaped" that appear to have been accurate warnings. There seems to have been some confusion about how ::truncateForVisual() is supposed to be used; in particular it is to be passed *unescaped* output, because it is not (generally speaking) safe to truncate HTML-escaped strings. The goal of ::truncateForVisual() is to have a specific number of codepoints in the output for display purposes, the encoding of those codepoints is not an issue (htmlspecialchars can be applied to the *return value*.) If you need a specific number of *bytes* you should be using ::truncateForDatabase(). If you want a certain number of *HTML bytes* then the ::truncateHtml() method is probably what you want. Slightly refactor some code in RevDelLogItem to avoid a false positive. Bug: T301205 Bug: T290624 Change-Id: I893362e049aedfa699043fcf27caf4815196f748
* | LogEventsList: Set context page for `{{PAGENAME}}` etc. in showLogExtract()Bartosz Dziewoński2022-02-101-1/+5
|/ | | | | Bug: T300184 Change-Id: I6e9356a6cc3b9df9b508c3d37a0b9b75d6825efd
* Merge "RCDatabaseLogEntry: Stop returning an unknown actor if rc_user is given"jenkins-bot2022-02-051-15/+31
|\
| * RCDatabaseLogEntry: Stop returning an unknown actor if rc_user is givenlens00212021-10-231-15/+31
| | | | | | | | | | | | | | | | | | | | | | In all cases that rc_actor is not given the function returns an unknown actor as ActorStore::newActorFromRowFields() throw exception in that cases. It is too strict because, for instance, RecentChange::newLogEntry() does not provide the attribute. This changes it. Bug: T286979 Change-Id: I5668053c30c18755536bfcb98524e79eb2827dda
* | LogEventsList: Simplify using the `...` splat operatorBartosz Dziewoński2022-01-311-8/+1
| | | | | | | | Change-Id: I84ce3a22e1f764f9797d40ca540a10492cbed151
* | Explicit cast TS_UNIX to int for arithmetic operations and int argsUmherirrender2022-01-112-4/+4
| | | | | | | | | | | | | | | | When the called function has a doc of int, it should be cast to be explicit here. Also cast for arithmetic operations to be explicit about the number Change-Id: I905b78dfb66e66443e0e3203488bab5b548db543
* | Refactor global variables to use MediaWikiServices insteadTChin2022-01-105-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI. Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228 * This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it. A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
* | Fix typos in comments (N-R)Siddharth VP2022-01-091-1/+1
| | | | | | | | Change-Id: I2d1bdb7531ff5126114a391550c2615ea6e244b3
* | Fix typos in comments (L)Siddharth VP2022-01-093-4/+4
| | | | | | | | Change-Id: I3deb34aec51504e09b20a367a93ebe863335be26
* | Allow setting max execution time to several special pagesAmir Sarabadani2021-12-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These special pages and their counter-part APIs are: - Special:RecentChanges - Special:Watchlist - Special:Log - Special:Contributions This also changes the way MAX_EXECUTION_TIME works from taking the value as milliseconds, it takes seconds which is more intuitive for users. Bug: T297708 Depends-On: I126e7181422d8da1a63afc3717faa4f72a687dd9 Change-Id: I3ff78751c3df3b6342f1865d35c2075f4415185d
* | Allow DeleteLogFormatter to work with pre-T20361 (April 2009) log rowsUmherirrender2021-12-041-1/+1
| | | | | | | | | | | | | | | | The i18n part of T20361 / ec0dd5b adds new log parameter, logs from before the changes are needed to work with the formatter. Bug: T289806 Change-Id: I096bc14373cbe038671fc33f651af7e005998a3b
* | Remove ActionAjaxAmir Sarabadani2021-12-011-2/+6
| | | | | | | | | | Bug: T42786 Change-Id: I8bda0c281e1f4abbffbddb80ac74a6d61a034d28
* | Remove or replace usages of "sane"Reedy2021-11-221-1/+0
|/ | | | | Bug: T254646 Change-Id: I096b2cf738a1395a14f1d47bcbed0c2c686c2581
* Merge "Change null to [] for html attributes on call of Html functions"jenkins-bot2021-09-291-1/+1
|\
| * Change null to [] for html attributes on call of Html functionsUmherirrender2021-09-221-1/+1
| | | | | | | | Change-Id: Ia84f5b1f210396cba5daa7b9e8bb8c4069e0171d
* | docs: LogFormatter: $plaintext and $irctext are booleanslens00212021-09-251-2/+2
|/ | | | | | | It seems all references to them assume the values as booleans. Code search: https://codesearch.wmcloud.org/deployed/?q=%5C%24this-%3E(plaintext%7Circtext)&i=nope&files=LogFormatter(test)%3F%5C.php&excludeFiles=&repos= Change-Id: I9bde1f7b1cac0ba9c0b002fd1b57a4407a4912ce
* Using @return never documentation on always-throw-functionUmherirrender2021-09-071-0/+2
| | | | | | | | | | This helps phan to detect unreachable code and also impossible types after the functions. It helps phan to avoid false positives for array keys when the keys are checked before Bug: T240141 Change-Id: I895f70e82b3053a46cd44135b15437e6f82a07b2
* build: Update mediawiki/mediawiki-phan-config to 0.11.0Umherirrender2021-09-076-5/+4
| | | | | | | Addition and remove of suppression needs to be done with the version update. Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
* logging: Cleanup LogEventsList constructorUmherirrender2021-08-311-16/+3
| | | | | | | | | Each Skin is a IContextSource, which makes the instanceof checks in the constructor not needed. Follows-up 265dd5d23c2 (I4e2dd5d3ab64) and 9712def7 (I6dde2a23d). Change-Id: Ibfb271bf61d03086433a9bb7b0e1081f01298615
* Fix BlockLogFormatter::formatBlockFlag() documentation for $flagDannyS7122021-08-291-1/+1
| | | | | | Its a string, not an int Change-Id: I70fc0f4c5f8f476843380c87126964e5de7f3d59
* Merge "Deprecate passing Skin to LogEventsList constructor"jenkins-bot2021-08-261-0/+3
|\
| * Deprecate passing Skin to LogEventsList constructorAmmarpad2021-06-081-0/+3
| | | | | | | | | | | | | | This was deprecated since 9712def7 but never raised deprecation warnings. No code is using the old parameters Change-Id: I4e2dd5d3ab64743fde89698fb986a2883aa9eb57
* | Narrow PageUpdater dependency from TitlePetr Pchelko2021-07-261-3/+11
| | | | | | | | | | | | | | | | Note: this contains a b/c incompatible change to SlotRoleHandler, but it's never used in any extensions and never was used. Change-Id: I898ab18467f7f8c605a579cc6236859b9d86c7f5
* | build: Updating dependencieslibraryupgrader2021-07-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 The following sniffs now pass and were enabled: * Generic.ControlStructures.InlineControlStructure * MediaWiki.PHPUnit.AssertCount.NotUsed npm: * svgo: 2.3.0 → 2.3.1 * https://npmjs.com/advisories/1754 (CVE-2021-33587) Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
* | More master -> primary documentation and internal var renamingJames D. Forrester2021-07-151-1/+1
| | | | | | | | | | Bug: T254646 Change-Id: I63cc8895033714bdfbf09aee933a8f0a43b387f3
* | Deprecate LogFormatter::styleRestricedElementAlexander Vorwerk2021-07-121-4/+15
| | | | | | | | | | | | | | | | | | LogFormatter::styleRestricedElement has been deprecated in favor of ::styleRestrictedElement in order to fix the typo in the method name. Bug: T286408 Change-Id: I27df9dab4dcc34594332c22b70348558f9e66fca
* | Remove hard-deprecated LogEntry::getPerformerPetr Pchelko2021-06-284-40/+38
| | | | | | | | Change-Id: Ia2c4819848f5d23d5ceb74aae9c6c5920b8851ba
* | Remove logging table index hintAmir Sarabadani2021-06-211-8/+0
| | | | | | | | | | | | | | It's not an issue anymore and keeping such hard-coded index is harmful Bug: T270620 Change-Id: I9198c29aa5e773a7521711ce4ef089a208f241ed
* | Use HTMLForm::setWrapperLegend and ::setSubmitTextMsg to set messagesUmherirrender2021-06-151-1/+1
|/ | | | | | | | setWrapperLegendMsg and setSubmitTextMsg are calling Message::text Replacing setSubmitText + Message::text with setSubmitTextMsg makes the code easier to read Change-Id: I73389991fea82e1927027dc95c3debc3d8c15939
* Use $wgEnablePartialActionBlocks feature flag for block list and block logtsepothoabala2021-06-021-2/+5
| | | | | Bug: T282457 Change-Id: I7c14054570bc6d7d93344499e6521703b8010621
* Remove some unneeded uses of full User objectsDannyS7122021-05-221-4/+4
| | | | Change-Id: Ib86399445a77d3005f23ae87d87f3cf742b13b1f
* Merge "Simplify use of 'label-raw' on html forms for tag-filter message"jenkins-bot2021-05-151-1/+1
|\
| * Simplify use of 'label-raw' on html forms for tag-filter messageUmherirrender2021-05-081-1/+1
| | | | | | | | | | | | | | label-message is using Message::parse, changing 'label-raw' with parse to label-message is a noop, but easier to read. Change-Id: I374142562cba591e15061df2640e5898770a10e5