AJAX, cause you love it. Props mdawaffe. fixes #2561
git-svn-id: http://svn.automattic.com/wordpress/trunk@3660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -101,7 +101,9 @@ function wp_specialchars( $text, $quotes = 0 ) {
|
||||
$text = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/', '&$1', $text);-
|
||||
$text = str_replace('<', '<', $text);
|
||||
$text = str_replace('>', '>', $text);
|
||||
if ( $quotes ) {
|
||||
if ( 'double' === $quotes ) {
|
||||
$text = str_replace('"', '"', $text);
|
||||
} elseif ( $quotes ) {
|
||||
$text = str_replace('"', '"', $text);
|
||||
$text = str_replace("'", ''', $text);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ var Fat = {
|
||||
b = b.toString(16); if (b.length == 1) b = '0' + b;
|
||||
return "#" + r + g + b;
|
||||
},
|
||||
fade_all : function ()
|
||||
fade_all : function (dur)
|
||||
{
|
||||
var a = document.getElementsByTagName("*");
|
||||
for (var i = 0; i < a.length; i++)
|
||||
@@ -21,7 +21,7 @@ var Fat = {
|
||||
if (r)
|
||||
{
|
||||
if (!r[1]) r[1] = "";
|
||||
if (o.id) Fat.fade_element(o.id,null,null,"#"+r[1]);
|
||||
if (o.id) Fat.fade_element(o.id,null,dur,"#"+r[1]);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -87,4 +87,4 @@ var Fat = {
|
||||
|
||||
addLoadEvent(function () {
|
||||
Fat.fade_all();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -237,6 +237,21 @@ function check_admin_referer() {
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( !function_exists('check_ajax_referer') ) :
|
||||
function check_ajax_referer() {
|
||||
$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 ( !wp_login( $user, $pass, true ) )
|
||||
die('-1');
|
||||
do_action('check_ajax_referer');
|
||||
}
|
||||
endif;
|
||||
|
||||
// Cookie safe redirect. Works around IIS Set-Cookie bug.
|
||||
// http://support.microsoft.com/kb/q176113/
|
||||
if ( !function_exists('wp_redirect') ) :
|
||||
|
||||
Reference in New Issue
Block a user