Make check_admin_referer() pluggable.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
81908816ab
commit
f035ac9b20
|
@ -966,14 +966,6 @@ function touch_time($edit = 1, $for_post = 1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_admin_referer() {
|
|
||||||
$adminurl = strtolower(get_settings('siteurl')).'/wp-admin';
|
|
||||||
$referer = strtolower($_SERVER['HTTP_REFERER']);
|
|
||||||
if (!strstr($referer, $adminurl))
|
|
||||||
die(__('Sorry, you need to <a href="http://codex.wordpress.org/Enable_Sending_Referrers">enable sending referrers</a> for this feature to work.'));
|
|
||||||
do_action('check_admin_referer');
|
|
||||||
}
|
|
||||||
|
|
||||||
// insert_with_markers: Owen Winkler, fixed by Eric Anderson
|
// insert_with_markers: Owen Winkler, fixed by Eric Anderson
|
||||||
// Inserts an array of strings into a file (.htaccess), placing it between
|
// Inserts an array of strings into a file (.htaccess), placing it between
|
||||||
// BEGIN and END markers. Replaces existing marked info. Retains surrounding
|
// BEGIN and END markers. Replaces existing marked info. Retains surrounding
|
||||||
|
|
|
@ -223,6 +223,16 @@ function auth_redirect() {
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
if ( !function_exists('check_admin_referer') ) :
|
||||||
|
function check_admin_referer() {
|
||||||
|
$adminurl = strtolower(get_settings('siteurl')).'/wp-admin';
|
||||||
|
$referer = strtolower($_SERVER['HTTP_REFERER']);
|
||||||
|
if (!strstr($referer, $adminurl))
|
||||||
|
die(__('Sorry, you need to <a href="http://codex.wordpress.org/Enable_Sending_Referrers">enable sending referrers</a> for this feature to work.'));
|
||||||
|
do_action('check_admin_referer');
|
||||||
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
// Cookie safe redirect. Works around IIS Set-Cookie bug.
|
// Cookie safe redirect. Works around IIS Set-Cookie bug.
|
||||||
// http://support.microsoft.com/kb/q176113/
|
// http://support.microsoft.com/kb/q176113/
|
||||||
if ( !function_exists('wp_redirect') ) :
|
if ( !function_exists('wp_redirect') ) :
|
||||||
|
|
Loading…
Reference in New Issue