added check_admin_referer()

git-svn-id: https://develop.svn.wordpress.org/trunk@1297 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
michelvaldrighi 2004-05-17 19:40:56 +00:00
parent 5ee0dc12cc
commit 771f496fe7

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