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 branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiDelete.php
diff --git
a/includes/api/ApiDelete.php
b/includes/api/ApiDelete.php
index
21e7b80
..
121cb48
100644
(file)
--- a/
includes/api/ApiDelete.php
+++ b/
includes/api/ApiDelete.php
@@
-46,13
+46,12
@@
class ApiDelete extends ApiBase {
public function execute() {
$params = $this->extractRequestParams();
public function execute() {
$params = $this->extractRequestParams();
- $titleObj = $this->getTitleOrPageId( $params );
- $pageObj = WikiPage::factory( $titleObj );
- $pageObj->loadPageData( 'fromdbmaster' );
+ $pageObj = $this->getTitleOrPageId( $params, 'fromdbmaster' );
if ( !$pageObj->exists() ) {
$this->dieUsageMsg( 'notanarticle' );
}
if ( !$pageObj->exists() ) {
$this->dieUsageMsg( 'notanarticle' );
}
+ $titleObj = $pageObj->getTitle();
$reason = ( isset( $params['reason'] ) ? $params['reason'] : null );
$user = $this->getUser();
$reason = ( isset( $params['reason'] ) ? $params['reason'] : null );
$user = $this->getUser();
@@
-112,7
+111,7
@@
class ApiDelete extends ApiBase {
// Need to pass a throwaway variable because generateReason expects
// a reference
$hasHistory = false;
// Need to pass a throwaway variable because generateReason expects
// a reference
$hasHistory = false;
- $reason = $page->getAutoDeleteReason( $hasHistory );
+ $reason = $page->getAutoDeleteReason( $hasHistory );
#FIXME: use ContentHandler::getAutoDeleteReason()
if ( $reason === false ) {
return array( array( 'cannotdelete', $title->getPrefixedText() ) );
}
if ( $reason === false ) {
return array( array( 'cannotdelete', $title->getPrefixedText() ) );
}