dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix property filter for ApiQueryStashImageInfo::getPropertyNames"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiOptions.php
diff --git
a/includes/api/ApiOptions.php
b/includes/api/ApiOptions.php
index
3ea827c
..
c4de31f
100644
(file)
--- a/
includes/api/ApiOptions.php
+++ b/
includes/api/ApiOptions.php
@@
-52,9
+52,9
@@
class ApiOptions extends ApiBase {
$this->dieWithError( [ 'apierror-missingparam', 'optionname' ] );
}
$this->dieWithError( [ 'apierror-missingparam', 'optionname' ] );
}
- if ( $params['reset'] ) {
- $this->resetPreferences( $params['resetkinds'] );
- $
changed = true
;
+ $resetKinds = $params['resetkinds'];
+ if ( !$params['reset'] ) {
+ $
resetKinds = []
;
}
$changes = [];
}
$changes = [];
@@
-68,6
+68,14
@@
class ApiOptions extends ApiBase {
$newValue = $params['optionvalue'] ?? null;
$changes[$params['optionname']] = $newValue;
}
$newValue = $params['optionvalue'] ?? null;
$changes[$params['optionname']] = $newValue;
}
+
+ Hooks::run( 'ApiOptions', [ $this, $user, $changes, $resetKinds ] );
+
+ if ( $resetKinds ) {
+ $this->resetPreferences( $resetKinds );
+ $changed = true;
+ }
+
if ( !$changed && !count( $changes ) ) {
$this->dieWithError( 'apierror-nochanges' );
}
if ( !$changed && !count( $changes ) ) {
$this->dieWithError( 'apierror-nochanges' );
}