ms_allowed_()
最后更新于:2021-11-27 16:07:36
ms_allowed_( bool$is_external, string$host)Adds any domain in a multisite installation for safe HTTP requests to the allowed list.
参数
- $is_external
-
(bool) (Required)
- $host
-
(string) (Required)
响应
(bool)
源文件
文件: gc-includes/http.php
function ms_allowed_http_request_hosts( $is_external, $host ) {
global $gcdb;
static $queried = array();
if ( $is_external ) {
return $is_external;
}
if ( get_network()->domain === $host ) {
return true;
}
if ( isset( $queried[ $host ] ) ) {
return $queried[ $host ];
}
$queried[ $host ] = (bool) $gcdb->get_var( $gcdb->prepare( "SELECT domain FROM $gcdb->blogs WHERE domain = %s LIMIT 1", $host ) );
return $queried[ $host ];
}