Admin AJAX tweaks from mdawaffe. fixes #2969

git-svn-id: https://develop.svn.wordpress.org/trunk@4042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-07-25 19:01:52 +00:00
parent d44fdf7d33
commit 31376ccaa9
3 changed files with 25 additions and 21 deletions
+1 -7
View File
@@ -13,12 +13,6 @@ if ( !is_user_logged_in() )
function get_out_now() { exit; }
add_action( 'shutdown', 'get_out_now', -1 );
function wp_clean_ajax_input( $i ) {
global $wpdb;
$i = is_array($i) ? array_map('wp_clean_ajax_input', $i) : $wpdb->escape( rawurldecode(stripslashes($i)) );
return $i;
}
function wp_ajax_echo_meta( $pid, $mid, $key, $value ) {
$value = wp_specialchars($value, true);
$key_js = addslashes(wp_specialchars($key, 'double'));
@@ -35,7 +29,6 @@ function wp_ajax_echo_meta( $pid, $mid, $key, $value ) {
return $r;
}
$_POST = wp_clean_ajax_input( $_POST );
$id = (int) $_POST['id'];
switch ( $_POST['action'] ) :
case 'delete-comment' :
@@ -224,6 +217,7 @@ case 'add-user' :
die($r);
break;
default :
do_action( 'wp_ajax_' . $_POST['action'] );
die('0');
break;
endswitch;