Rename mw.util.wikiGetlink to getUrl
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 4dd1713..c11f16c 100644 (file)
@@ -383,13 +383,8 @@ class ApiMain extends ApiBase {
                        wfRunHooks( 'ApiMain::onException', array( $this, $e ) );
 
                        // Log it
-                       if ( $e instanceof MWException && !( $e instanceof UsageException ) ) {
-                               global $wgLogExceptionBacktrace;
-                               if ( $wgLogExceptionBacktrace ) {
-                                       wfDebugLog( 'exception', $e->getLogMessage() . "\n" . $e->getTraceAsString() . "\n" );
-                               } else {
-                                       wfDebugLog( 'exception', $e->getLogMessage() );
-                               }
+                       if ( !( $e instanceof UsageException ) ) {
+                               MWExceptionHandler::logException( $e );
                        }
 
                        // Handle any kind of exception by outputting properly formatted error message.
@@ -714,15 +709,9 @@ class ApiMain extends ApiBase {
                }
                $moduleParams = $module->extractRequestParams();
 
-               // Die if token required, but not provided (unless there is a gettoken parameter)
-               if ( isset( $moduleParams['gettoken'] ) ) {
-                       $gettoken = $moduleParams['gettoken'];
-               } else {
-                       $gettoken = false;
-               }
-
+               // Die if token required, but not provided
                $salt = $module->getTokenSalt();
-               if ( $salt !== false && !$gettoken ) {
+               if ( $salt !== false ) {
                        if ( !isset( $moduleParams['token'] ) ) {
                                $this->dieUsageMsg( array( 'missingparam', 'token' ) );
                        } else {