Last active
April 2, 2018 07:43
-
-
Save nahakiole/843fb9a29292bfcf012b to your computer and use it in GitHub Desktop.
Check user agent for curl or wget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/(curl|wget)/i", $_SERVER['HTTP_USER_AGENT'])) { | |
/* | |
Request is made with curl or wget (Or with modified user agent header) | |
*/ | |
} | |
//Regular request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment