I am working on custom theme update script that works fine but after the update if you click on update success notification link "Show Details" , the full link to update is displayed.
and since I was doing this in my download script
if(isset($_GET['download'])){
// run download
}else{
exit;
}
you were able to copy the link and download the zip directly.
I checked another download script that checks for user_agent , and if WordPress string is within it allows the download so I made a mod to my script like so
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if(isset($_GET['download']) && stristr( $user_agent, 'WordPress' ) == TRUE ){
// run download
}else{
exit;
}
now I am not sure how reliable this is so my question is is there a reliable string/header anything that is sent by update-core.php?action=do-theme-upgrade
that I can check for to make sure that only WordPress install is allowed to download the update.