aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2024-04-10 20:26:23 +0200
committerReedy <reedy@wikimedia.org>2024-04-22 19:31:32 +0000
commitd2173d22fd1b3efafdbc97d64a1b56a74a3ade87 (patch)
tree7ba3b01c2fd087a62f2a35d621d19ebd043c778c /includes
parent375aa2185b40f6c2531f2f040375bf435ed08048 (diff)
downloadmediawikicore-d2173d22fd1b3efafdbc97d64a1b56a74a3ade87.tar.gz
mediawikicore-d2173d22fd1b3efafdbc97d64a1b56a74a3ade87.zip
api: Replace null $httpCode by 0 in ApiBase::dieWithErrorOrDebug
The $httpCode is passed to Exception::__construct and type-hinted as integer since php8.2 When a module requires POST, but is used with GET a deprecation notice is shown in php8.2 validatepassword: Passing null to parameter #2 ($code) of type int is deprecated Bug: T362272 Change-Id: Ib5c6a24abf0808a0557c57170279b325b4bddcea (cherry picked from commit e92f7fbdbe72b03ace170bbe7d2cef79ff32a7ff)
Diffstat (limited to 'includes')
-rw-r--r--includes/api/ApiBase.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 0881411ffc0f..428fcd88f713 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -1624,7 +1624,7 @@ abstract class ApiBase extends ContextSource {
*/
public function dieWithErrorOrDebug( $msg, $code = null, $data = null, $httpCode = null ) {
if ( $this->getConfig()->get( MainConfigNames::DebugAPI ) !== true ) {
- $this->dieWithError( $msg, $code, $data, $httpCode );
+ $this->dieWithError( $msg, $code, $data, $httpCode ?? 0 );
} else {
$this->addWarning( $msg, $code, $data );
}