added check_admin_referer()

git-svn-id: http://svn.automattic.com/wordpress/trunk@1297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
michelvaldrighi 2004-05-17 19:40:56 +00:00
parent b5e7e0da79
commit 9af64b9a69

View File

@ -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.');
}
}
?>