예제 #1
0
function shCheckVMCookieRedirect()
{
    $shPageInfo =& shRouter::shPageInfo();
    if (shIsSearchEngine() && strpos($shPageInfo->shCurrentPageURL, 'vmchk/') !== false) {
        shRedirect(str_replace('vmchk/', '', $shPageInfo->shCurrentPageURL));
    }
}
function shCheckVMCookieRedirect() {

  $pageInfo = & Sh404sefFactory::getPageInfo();

  if (shIsSearchEngine() && strpos($pageInfo->shCurrentPageURL, 'vmchk/') !== false) {
    shRedirect( str_replace('vmchk/', '', $pageInfo->shCurrentPageURL));
  }
}
예제 #3
0
파일: shInit.php 프로젝트: sangkasi/joomla
            if (!empty($shPageInfo->URI->host) && strpos($GLOBALS['shConfigLiveSite'], $shPageInfo->URI->host) === false && strpos($sefConfig->shConfig_live_secure_site, $shPageInfo->URI->host) === false) {
                _log('Redirecting to home : host don\'t match our config : ' . $GLOBALS['shConfigLiveSite'] . ' | ' . $shPageInfo->URI->host . ' | ' . $sefConfig->shConfig_live_secure_site);
                shRedirect($GLOBALS['shConfigLiveSite']);
            } else {
                $shPageInfo->shCurrentPagePath = $shPageInfo->URI->protocol . '://' . $shPageInfo->URI->host . (!sh404SEF_USE_NON_STANDARD_PORT || empty($shPageInfo->URI->port) ? '' : ':' . $shPageInfo->URI->port) . $shPageInfo->URI->path;
                $shPageInfo->shCurrentPagePath = shUrlDecode($shPageInfo->shCurrentPagePath);
                $shPageInfo->shCurrentPagePath = str_replace($GLOBALS['shConfigLiveSite'], '', $shPageInfo->shCurrentPagePath);
                _log('Current page path : ' . $shPageInfo->shCurrentPagePath);
                $qString = $shPageInfo->URI->getQueryString();
                $shPageInfo->shCurrentPageURL = empty($qString) ? $shPageInfo->shCurrentPagePath : $shPageInfo->shCurrentPagePath . '?' . JString::ltrim($qString, '&');
                $rewriteBit = empty($sefConfig->shRewriteMode) ? '' : JString::rtrim($sefConfig->shRewriteStrings[$sefConfig->shRewriteMode], '/');
                $shPageInfo->baseUrl = $GLOBALS['shConfigLiveSite'] . $rewriteBit . $shPageInfo->shCurrentPagePath;
                _log('Current base url : ' . $shPageInfo->baseUrl);
                // V 1.2.4.s PR2 : workaround for Virtuemart cookie check issue
                // see second part in shSef404.php
                if (shIsSearchEngine()) {
                    // simulate doing successfull cookie check
                    _log('Setting VMCHECK cookie for search engine');
                    $_COOKIE['VMCHECK'] = 'OK';
                    $_REQUEST['vmcchk'] = 1;
                    // from VM 1.1.2 onward, result is stored in session, not cookie
                    $_SESSION['VMCHECK'] = 'OK';
                }
            }
        } else {
            JError::RaiseError(COM_SH404SEF_NOREAD . "( {$sef404} )<br />" . COM_SH404SEF_CHK_PERMS);
        }
    }
    // save page info
    shRouter::shPageInfo($shPageInfo);
}
예제 #4
0
function shCheckVMCookieRedirect()
{
    global $shCurrentPageURL;
    if (shIsSearchEngine() && strpos($shCurrentPageURL, 'vmchk/') !== false) {
        shRedirect(str_replace('vmchk/', '', $shCurrentPageURL));
    }
}
예제 #5
0
         $vars['Itemid'] = $shHomePage->id;
         $_SERVER['QUERY_STRING'] = $shPageInfo->QUERY_STRING = str_replace('index.php?', '', $shHomeLink);
         $REQUEST_URI = $shPageInfo->base . 'index.php?' . $shPageInfo->QUERY_STRING;
         $_SERVER['REQUEST_URI'] = $REQUEST_URI;
         $shPageInfo->shCurrentPageNonSef = 'index.php?' . $shPageInfo->QUERY_STRING;
         // V 1.2.4.s
         _log('Homepage non-sef = ' . $shPageInfo->shCurrentPageNonSef);
         $matches = array();
         if (preg_match("/option=([a-zA-Z_0-9]+)/", $shPageInfo->QUERY_STRING, $matches)) {
             $vars['option'] = $matches[1];
         }
         // stitch back query vars together
         parse_str($shPageInfo->QUERY_STRING, $varsTmp);
         $vars = array_merge($vars, $varsTmp);
         // version x allow automatic language detection
         if (!shIsSearchEngine()) {
             shGuessLanguageAndRedirect($shPageInfo->QUERY_STRING);
         }
         unset($matches);
         if (!headers_sent()) {
             header('HTTP/1.0 200 OK');
         }
     }
 } else {
     if (shShouldRedirectFromNonSef($shPageInfo)) {
         // try fetching from DB
         $shSefUrl = null;
         $shNonSefUrl = str_replace(empty($shPageInfo->shHttpsSave) ? $GLOBALS['shConfigLiveSite'] : $shPageInfo->shHttpsSave, '', $shPageInfo->URI->url);
         $shNonSefUrl = JString::ltrim($shNonSefUrl, '/');
         if (!preg_match('/(&|\\?)lang=[a-zA-Z]{2,3}/iU', $shNonSefUrl)) {
             $shNonSefUrl = shSetURLVar($shNonSefUrl, 'lang', shGetIsoCodeFromName($GLOBALS['shMosConfig_locale']));