Allow ['action'] in admin-ajax.php. Props misterbisson. fixes #7945

git-svn-id: http://svn.automattic.com/wordpress/trunk@9281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-10-22 17:15:19 +00:00
parent ef44f75f79
commit 2d2c0736e3
1 changed files with 10 additions and 2 deletions

View File

@ -37,7 +37,9 @@ if ( ! is_user_logged_in() ) {
die('-1');
}
if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
if ( isset( $_GET['action'] ) ) :
switch ( $action = $_GET['action'] ) :
case 'ajax-tag-search' :
if ( !current_user_can( 'manage_categories' ) )
die('-1');
@ -53,7 +55,13 @@ if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
$results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" );
echo join( $results, "\n" );
die;
}
break;
default :
do_action( 'wp_ajax_' . $_GET['action'] );
die('0');
break;
endswitch;
endif;
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
switch ( $action = $_POST['action'] ) :