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 "Added assertArrayEquals method to MediaWikiTestCase to avoid duplicating asort...
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiProtect.php
diff --git
a/includes/api/ApiProtect.php
b/includes/api/ApiProtect.php
index
d156468
..
0fcaf42
100644
(file)
--- a/
includes/api/ApiProtect.php
+++ b/
includes/api/ApiProtect.php
@@
-56,7
+56,7
@@
class ApiProtect extends ApiBase {
}
$restrictionTypes = $titleObj->getRestrictionTypes();
}
$restrictionTypes = $titleObj->getRestrictionTypes();
- $db
r = wfGetDB( DB_SLAVE
);
+ $db
= $this->getDB(
);
$protections = array();
$expiryarray = array();
$protections = array();
$expiryarray = array();
@@
-80,7
+80,7
@@
class ApiProtect extends ApiBase {
}
if ( in_array( $expiry[$i], array( 'infinite', 'indefinite', 'never' ) ) ) {
}
if ( in_array( $expiry[$i], array( 'infinite', 'indefinite', 'never' ) ) ) {
- $expiryarray[$p[0]] = $db
r
->getInfinity();
+ $expiryarray[$p[0]] = $db->getInfinity();
} else {
$exp = strtotime( $expiry[$i] );
if ( $exp < 0 || !$exp ) {
} else {
$exp = strtotime( $expiry[$i] );
if ( $exp < 0 || !$exp ) {
@@
-94,7
+94,7
@@
class ApiProtect extends ApiBase {
$expiryarray[$p[0]] = $exp;
}
$resultProtections[] = array( $p[0] => $protections[$p[0]],
$expiryarray[$p[0]] = $exp;
}
$resultProtections[] = array( $p[0] => $protections[$p[0]],
- 'expiry' => ( $expiryarray[$p[0]] == $db
r
->getInfinity() ?
+ 'expiry' => ( $expiryarray[$p[0]] == $db->getInfinity() ?
'infinite' :
wfTimestamp( TS_ISO_8601, $expiryarray[$p[0]] ) ) );
}
'infinite' :
wfTimestamp( TS_ISO_8601, $expiryarray[$p[0]] ) ) );
}
@@
-184,6
+184,16
@@
class ApiProtect extends ApiBase {
);
}
);
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'title' => 'string',
+ 'reason' => 'string',
+ 'cascade' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return 'Change the protection level of a page';
}
public function getDescription() {
return 'Change the protection level of a page';
}