X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAjaxDispatcher.php;h=e22fe20af95b38b8cf9c1ee6294fe6f6ebb50bc6;hb=5b04704d304968ca49b6190ed0dd1d5ad819db45;hp=e3df5207666e3695c05bed577829a99883b73787;hpb=5e18423043c4e1646e1e500ce8852f6c99d06317;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index e3df520766..e22fe20af9 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -63,7 +63,7 @@ class AjaxDispatcher { $this->mode = "post"; } - switch( $this->mode ) { + switch ( $this->mode ) { case 'get': $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : ''; if ( ! empty( $_GET["rsargs"] ) ) { @@ -97,7 +97,7 @@ class AjaxDispatcher { * request. */ function performAction() { - global $wgAjaxExportList, $wgOut, $wgUser; + global $wgAjaxExportList, $wgUser; if ( empty( $this->mode ) ) { return; @@ -113,7 +113,7 @@ class AjaxDispatcher { 'Bad Request', "unknown function " . (string) $this->func_name ); - } elseif ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) + } elseif ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) && !$wgUser->isAllowed( 'read' ) ) { wfHttpError( @@ -123,14 +123,8 @@ class AjaxDispatcher { } else { wfDebug( __METHOD__ . ' dispatching ' . $this->func_name . "\n" ); - if ( strpos( $this->func_name, '::' ) !== false ) { - $func = explode( '::', $this->func_name, 2 ); - } else { - $func = $this->func_name; - } - try { - $result = call_user_func_array( $func, $this->args ); + $result = call_user_func_array( $this->func_name, $this->args ); if ( $result === false || $result === null ) { wfDebug( __METHOD__ . ' ERROR while dispatching ' @@ -163,7 +157,6 @@ class AjaxDispatcher { } } - $wgOut = null; wfProfileOut( __METHOD__ ); } }