Hi @timsayshey Strange – I’m not getting any issues on my end so it’s likely not API related.
Do you have any other sites you can test on to see if maybe this is a security thing blocking on this specific site?
if ( false !== strpos( $url, $server_ip ) || false !== strpos( $url, $server_name ) ) {
return false;
}
The error was being caused by the above security check. For some reason my server has SERVER_ADDR and SERVER_NAME set to NULL. Guess it has something to do with Caddy, Docker or Cloudflare. For now I am defaulting them in the config.php to get by which solved the error.
Interesting. And nice find, I wouldn’t have been able to diagnose this for you.
This ‘fix’ was put in place last release because of an admin level exploit.
🤔Need to think about how to account for this. Maybe I could add a constant or something where if it’s in the WP Config it skips this additional security check.
This is what I put in my config file that checks to make sure the two values are set, and they aren’t, it falls back:
$_SERVER['SERVER_ADDR'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR'];
$_SERVER['SERVER_NAME'] = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
@timsayshey Thanks for providing this.