Ejemplo n.º 1
0
function _Check404Error(){
   if(defined('ERROR_404') && ERROR_404=='Y' || CHTTP::GetLastStatus() == "404 Not Found"){
      global $APPLICATION;
      $APPLICATION->RestartBuffer();
      require ($_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/header.php');
      require $_SERVER['DOCUMENT_ROOT'].'/404.php';
      require ($_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/footer.php');
   }
}
Ejemplo n.º 2
0
        if (w.opera == "[object Opera]") {
            d.addEventListener("DOMContentLoaded", f, false);
        } else { f(); }
    })(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/29322070" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
</body>
</html>

<?php 
if (!strlen(trim($APPLICATION->GetProperty('H1')))) {
    $APPLICATION->SetPageProperty('H1', $APPLICATION->GetTitle());
}
if ($APPLICATION->GetProperty('SHOW_H1') != 'N') {
    $APPLICATION->SetPageProperty('_h1', '<h1 class="title_page">' . $APPLICATION->GetProperty('h1') . '</h1>');
}
if (strlen(trim($APPLICATION->GetProperty('ARTICLE_CLASS'))) == 0) {
    $APPLICATION->SetPageProperty('ARTICLE_CLASS', $APPLICATION->GetProperty('ARTICLE_CLASS') . " b_dop_content");
}
$page = $APPLICATION->GetCurPage();
if (CHTTP::GetLastStatus() == "404 Not Found" && $page != "/404.php") {
    if (preg_match("/\\/(.*?)[^\\/]\$/i", $page, $arRes)) {
        LocalRedirect($arRes[0] . "/");
        die;
    }
    $APPLICATION->RestartBuffer();
    echo file_get_contents("http://" . $_SERVER["SERVER_NAME"] . "/404.php?404=N");
    die;
}
Ejemplo n.º 3
0
 /**
  * Returns true if file exists
  * with predefined path (current request uri)
  *
  * @return bool
  */
 public function isCacheable()
 {
     if ($this->cacheFile) {
         if (isset($_SESSION["SESS_SHOW_TIME_EXEC"]) && $_SESSION["SESS_SHOW_TIME_EXEC"] == 'Y') {
             return false;
         } elseif (isset($_SESSION["SHOW_SQL_STAT"]) && $_SESSION["SHOW_SQL_STAT"] == 'Y') {
             return false;
         } elseif (isset($_SESSION["SHOW_CACHE_STAT"]) && $_SESSION["SHOW_CACHE_STAT"] == 'Y') {
             return false;
         }
         $httpStatus = \CHTTP::GetLastStatus();
         if ($httpStatus == 200 || $httpStatus === "") {
             return $this->canCache;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Ejemplo n.º 4
0
 /**
  * Returns true if we can cache current request
  *
  * @return bool
  */
 public function isCacheable()
 {
     if ($this->storage === null) {
         return false;
     }
     if ($this->cacheProvider !== null && $this->cacheProvider->isCacheable() === false) {
         return false;
     }
     if (isset($_SESSION["SESS_SHOW_TIME_EXEC"]) && $_SESSION["SESS_SHOW_TIME_EXEC"] == 'Y') {
         return false;
     } elseif (isset($_SESSION["SHOW_SQL_STAT"]) && $_SESSION["SHOW_SQL_STAT"] == 'Y') {
         return false;
     } elseif (isset($_SESSION["SHOW_CACHE_STAT"]) && $_SESSION["SHOW_CACHE_STAT"] == 'Y') {
         return false;
     }
     $httpStatus = intval(\CHTTP::GetLastStatus());
     if ($httpStatus == 200 || $httpStatus === 0) {
         return $this->canCache;
     }
     return false;
 }