mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
added check_admin_referer()
git-svn-id: http://svn.automattic.com/wordpress/trunk@1297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b5e7e0da79
commit
9af64b9a69
@ -367,4 +367,12 @@ function touch_time($edit = 1) {
|
||||
<?php
|
||||
}
|
||||
|
||||
function check_admin_referer() {
|
||||
$adminurl = url_shorten(strtolower(get_settings('siteurl'))).'/wp-admin';
|
||||
$referer = url_shorten(strtolower($_SERVER['HTTP_REFERER']));
|
||||
if (substr($referer, 0, strlen($adminurl)) != $adminurl) {
|
||||
die('Sorry, you need to enable sending referrers, for this feature to work.');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user