Skip to content

Commit

Permalink
Allow ajax handler to manage POST requests.
Browse files Browse the repository at this point in the history
This previously only accepted GET requests.
  • Loading branch information
Michael Sisk committed Jan 24, 2013
1 parent f6e8843 commit e8fa88d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions -/php/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ public function deactivate() {
* @hook admin_init
*/
public function admin_init() {
if ( isset( $_GET[ 'webcomic_admin_ajax' ] ) and isset( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) and 'xmlhttprequest' === strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) ) {
call_user_func_array( explode( '::', $_GET[ 'webcomic_admin_ajax' ] ), $_GET );
if ( ( isset( $_GET[ 'webcomic_admin_ajax' ] ) or isset( $_POST[ 'webcomic_admin_ajax' ] ) ) and isset( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) and 'xmlhttprequest' === strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) ) {
call_user_func_array( explode( '::', isset( $_GET[ 'webcomic_admin_ajax' ] ) ? $_GET[ 'webcomic_admin_ajax' ] : $_POST[ 'webcomic_admin_ajax' ] ), isset( $_GET[ 'webcomic_admin_ajax' ] ) ? $_GET : $_POST );

die;
}
Expand Down

0 comments on commit e8fa88d

Please sign in to comment.