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 "Allow putting the app ID in the password for bot passwords"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialChangeContentModel.php
diff --git
a/includes/specials/SpecialChangeContentModel.php
b/includes/specials/SpecialChangeContentModel.php
index
ee9f665
..
b37c475
100644
(file)
--- a/
includes/specials/SpecialChangeContentModel.php
+++ b/
includes/specials/SpecialChangeContentModel.php
@@
-84,12
+84,20
@@
class SpecialChangeContentModel extends FormSpecialPage {
],
];
if ( $this->title ) {
],
];
if ( $this->title ) {
+ $options = $this->getOptionsForTitle( $this->title );
+ if ( empty( $options ) ) {
+ throw new ErrorPageError(
+ 'changecontentmodel-emptymodels-title',
+ 'changecontentmodel-emptymodels-text',
+ $this->title->getPrefixedText()
+ );
+ }
$fields['pagetitle']['readonly'] = true;
$fields += [
'model' => [
'type' => 'select',
'name' => 'model',
$fields['pagetitle']['readonly'] = true;
$fields += [
'model' => [
'type' => 'select',
'name' => 'model',
- 'options' => $
this->getOptionsForTitle( $this->title )
,
+ 'options' => $
options
,
'label-message' => 'changecontentmodel-model-label'
],
'reason' => [
'label-message' => 'changecontentmodel-model-label'
],
'reason' => [
@@
-183,7
+191,14
@@
class SpecialChangeContentModel extends FormSpecialPage {
// Page doesn't exist, create an empty content object
$newContent = ContentHandler::getForModelID( $data['model'] )->makeEmptyContent();
}
// Page doesn't exist, create an empty content object
$newContent = ContentHandler::getForModelID( $data['model'] )->makeEmptyContent();
}
+
+ // All other checks have passed, let's check rate limits
+ if ( $user->pingLimiter( 'editcontentmodel' ) ) {
+ throw new ThrottledError();
+ }
+
$flags = $this->oldRevision ? EDIT_UPDATE : EDIT_NEW;
$flags = $this->oldRevision ? EDIT_UPDATE : EDIT_NEW;
+ $flags |= EDIT_INTERNAL;
if ( $user->isAllowed( 'bot' ) ) {
$flags |= EDIT_FORCE_BOT;
}
if ( $user->isAllowed( 'bot' ) ) {
$flags |= EDIT_FORCE_BOT;
}