Index: trunk/extensions/TitleBlacklist/api/ApiQueryTitleBlacklist.php |
— | — | @@ -27,10 +27,8 @@ |
28 | 28 | * @ingroup API |
29 | 29 | * @ingroup Extensions |
30 | 30 | */ |
| 31 | +class ApiQueryTitleBlacklist extends ApiBase { |
31 | 32 | |
32 | | - |
33 | | -class ApiQueryTitleBlacklist extends ApiQueryBase { |
34 | | - |
35 | 33 | public function __construct( $query, $moduleName ) { |
36 | 34 | parent::__construct( $query, $moduleName, 'tb' ); |
37 | 35 | } |
— | — | @@ -39,7 +37,7 @@ |
40 | 38 | # get the current user. |
41 | 39 | $context = $this->createContext(); |
42 | 40 | $user = $context->getUser(); |
43 | | - |
| 41 | + |
44 | 42 | $params = $this->extractRequestParams(); |
45 | 43 | $action = $params['action']; |
46 | 44 | |
— | — | @@ -59,13 +57,14 @@ |
60 | 58 | htmlspecialchars( $blacklisted->getRaw() ), |
61 | 59 | htmlspecialchars( $params['title'] ), |
62 | 60 | ); |
63 | | - |
64 | | - $this->getResult()->addValue( 'titleblacklist', 'result', 'blacklisted' ); |
| 61 | + |
| 62 | + $result = $this->getResult(); |
| 63 | + $result->addValue( 'titleblacklist', 'result', 'blacklisted' ); |
65 | 64 | // this is hardcoded to 'edit' in Titleblacklist.hooks.php, duplicating that. |
66 | 65 | $message = $blacklisted->getErrorMessage( 'edit' ); |
67 | | - $this->getResult()->addValue( 'titleblacklist', 'reason', wfMessage( $message, $result )->text() ); |
68 | | - $this->getResult()->addValue( 'titleblacklist', 'message', $message ); |
69 | | - $this->getResult()->addValue( 'titleblacklist', 'line', htmlspecialchars( $blacklisted->getRaw() ) ); |
| 66 | + $result->addValue( 'titleblacklist', 'reason', wfMessage( $message, $result )->text() ); |
| 67 | + $result->addValue( 'titleblacklist', 'message', $message ); |
| 68 | + $result->addValue( 'titleblacklist', 'line', htmlspecialchars( $blacklisted->getRaw() ) ); |
70 | 69 | } else { |
71 | 70 | // not blacklisted |
72 | 71 | $this->getResult()->addValue( 'titleblacklist', 'result', 'ok' ); |