jquery for list manipulation. Round one, fight. Props mdawaffe. fixes #4805

git-svn-id: https://develop.svn.wordpress.org/trunk@6213 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-10-09 22:49:42 +00:00
parent 1e41dc0c9e
commit 490789554f
27 changed files with 453 additions and 377 deletions
+18 -15
View File
@@ -346,23 +346,26 @@ function check_admin_referer($action = -1) {
}endif;
if ( !function_exists('check_ajax_referer') ) :
function check_ajax_referer() {
$current_name = '';
if ( ( $current = wp_get_current_user() ) && $current->ID )
$current_name = $current->data->user_login;
if ( !$current_name )
die('-1');
function check_ajax_referer( $action = -1 ) {
$nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];
if ( !wp_verify_nonce( $nonce, $action ) ) {
$current_name = '';
if ( ( $current = wp_get_current_user() ) && $current->ID )
$current_name = $current->data->user_login;
if ( !$current_name )
die('-1');
$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = substr(strstr($tasty, '='), 1);
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = substr(strstr($tasty, '='), 1);
$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = substr(strstr($tasty, '='), 1);
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = substr(strstr($tasty, '='), 1);
}
if ( $current_name != $user || !wp_login( $user, $pass, true ) )
die('-1');
}
if ( $current_name != $user || !wp_login( $user, $pass, true ) )
die('-1');
do_action('check_ajax_referer');
}
endif;