91         $iLang = (int) $iLang;
 
   92         $iDefLang = (int) $this->
getConfig()->getConfigParam(
'iDefSeoLang');
 
   95         if ($iLang != $iDefLang &&
 
   96             isset($aLangIds[$iLang]) &&
 
  100             $sSeoUrl = $aLangIds[$iLang] . 
'/' . $sSeoUrl;
 
  118     protected function _processSeoUrl($sSeoUrl, $sObjectId = null, $iLang = null, $blExclude = 
false)
 
  133         if (!self::$_sSeparator) {
 
  136         if (!self::$_sPrefix) {
 
  151     protected function _copyToHistory($sId, $iShopId, $iLang, $sType = null, $sNewId = null)
 
  154         $sObjectid = $sNewId ? $oDb->quote($sNewId) : 
'oxobjectid';
 
  155         $sType = $sType ? 
"oxtype =" . $oDb->quote($sType) . 
" and" : 
'';
 
  156         $iLang = (int) $iLang;
 
  159         $sSub = 
"select $sObjectid, MD5( LOWER( oxseourl ) ), oxshopid, oxlang, now() from oxseo 
  160                  where {$sType} oxobjectid = " . $oDb->quote($sId) . 
" and oxshopid = " . $oDb->quote($iShopId) . 
" and 
  161                  oxlang = {$iLang} and oxexpired = '1'";
 
  162         $sQ = 
"replace oxseohistory ( oxobjectid, oxident, oxshopid, oxlang, oxinsert ) {$sSub}";
 
  190         $iShopId = $this->
getConfig()->getShopId();
 
  192         $sStdUrl = $this->
_trimUrl($sStdUrl);
 
  197         $sOldSeoUrl = $this->
_loadFromDb(
'dynamic', $sObjectId, $iLang);
 
  198         if ($sOldSeoUrl === $sSeoUrl) {
 
  199             $sSeoUrl = $sOldSeoUrl;
 
  211             $this->
_saveToDb(
'dynamic', $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId);
 
  226     protected function _getFullUrl($sSeoUrl, $iLang = null, $blSsl = 
false)
 
  229             $sFullUrl = ($blSsl ? $this->
getConfig()->getSslShopUrl($iLang) : $this->
getConfig()->getShopUrl($iLang, 
false)) . $sSeoUrl;
 
  248         return md5(strtolower($sSeoUrl));
 
  262         $sStdUrl = $this->
_trimUrl($sStdUrl, $iLang);
 
  291         $sSeoUrl = $this->
_prepareUri($sSeoUrl, $iObjectLang);
 
  294         if ($oStr->preg_match(
'/(\.html?|\/)$/i', $sSeoUrl, $aMatched)) {
 
  295             $sExt = $aMatched[0];
 
  297         $sBaseSeoUrl = $sSeoUrl;
 
  298         if ($sExt && $oStr->substr($sSeoUrl, 0 - $oStr->strlen($sExt)) == $sExt) {
 
  299             $sBaseSeoUrl = $oStr->substr($sSeoUrl, 0, $oStr->strlen($sSeoUrl) - $oStr->strlen($sExt));
 
  302         $iShopId = $this->
getConfig()->getShopId();
 
  304         $sCheckSeoUrl = $this->
_trimUrl($sSeoUrl);
 
  305         $sQ = 
"select 1 from oxseo where oxshopid = '{$iShopId}'";
 
  309         if ($sObjectId && isset($iObjectLang)) {
 
  310             $iObjectLang = (int) $iObjectLang;
 
  311             $sQ .= 
" and not (oxobjectid = " . $oDb->quote($sObjectId) . 
" and oxlang = $iObjectLang)";
 
  314         while ($oDb->getOne($sQ . 
" and oxident= " . $oDb->quote($this->_getSeoIdent($sCheckSeoUrl)))) {
 
  316             if (self::$_sPrefix) {
 
  320                 $sAdd .= self::$_sSeparator . $iCnt;
 
  324             $sSeoUrl = $sBaseSeoUrl . $sAdd . $sExt;
 
  325             $sCheckSeoUrl = $this->
_trimUrl($sSeoUrl);
 
  345     protected function _isFixed($sType, $sId, $iLang, $iShopId = null, $sParams = null, $blStrictParamsCheck = 
true)
 
  347         if ($iShopId === null) {
 
  348             $iShopId = $this->
getConfig()->getShopId();
 
  350         $iLang = (int) $iLang;
 
  352         if (!isset(self::$_aFixedCache[$sType][$sShopId][$sId][$iLang])) {
 
  355             $sQ = 
"SELECT `oxfixed` 
  357                 WHERE `oxtype` = " . $oDb->quote($sType) . 
" 
  358                    AND `oxobjectid` = " . $oDb->quote($sId) . 
" 
  359                    AND `oxshopid` = " . $oDb->quote($iShopId) . 
" 
  360                    AND `oxlang` = '{$iLang}'";
 
  362             $sParams = $sParams ? $oDb->quote($sParams) : 
"''";
 
  363             if ($sParams && $blStrictParamsCheck) {
 
  364                 $sQ .= 
" AND `oxparams` = {$sParams}";
 
  366                 $sQ .= 
" ORDER BY `oxparams` ASC";
 
  370             self::$_aFixedCache[$sType][$sShopId][$sId][$iLang] = (bool) $oDb->getOne($sQ);
 
  373         return self::$_aFixedCache[$sType][$sShopId][$sId][$iLang];
 
  386     protected function _getCacheKey($sType, $iLang = null, $iShopId = null, $sParams = null)
 
  389         if (!$blAdmin && $sType !== 
"oxarticle") {
 
  390             return $sType . ((int) $iLang) . ((int) $iShopId) . 
"seo";
 
  394         if (self::$_sCacheKey === null) {
 
  395             self::$_sCacheKey = 
false;
 
  396             if (!$blAdmin && ($oView = $this->
getConfig()->getActiveView())) {
 
  397                 self::$_sCacheKey = md5($oView->getViewId()) . 
"seo";
 
  415     protected function _loadFromCache($sCacheIdent, $sType, $iLang = null, $iShopId = null, $sParams = null)
 
  417         if (!$this->
getConfig()->getConfigParam(
'blEnableSeoCache')) {
 
  421         startProfile(
"seoencoder_loadFromCache");
 
  423         $sCacheKey = $this->
_getCacheKey($sType, $iLang, $iShopId, $sParams);
 
  426         if ($sCacheKey && !isset(self::$_aCache[$sCacheKey])) {
 
  430         if (isset(self::$_aCache[$sCacheKey]) && isset(self::$_aCache[$sCacheKey][$sCacheIdent])) {
 
  431             $sCache = self::$_aCache[$sCacheKey][$sCacheIdent];
 
  434         stopProfile(
"seoencoder_loadFromCache");
 
  451     protected function _saveInCache($sCacheIdent, $sCache, $sType, $iLang = null, $iShopId = null, $sParams = null)
 
  453         if (!$this->
getConfig()->getConfigParam(
'blEnableSeoCache')) {
 
  457         startProfile(
"seoencoder_saveInCache");
 
  460         if ($sCache && ($sCacheKey = $this->
_getCacheKey($sType, $iLang, $iShopId, $sParams)) !== 
false) {
 
  461             self::$_aCache[$sCacheKey][$sCacheIdent] = $sCache;
 
  465         stopProfile(
"seoencoder_saveInCache");
 
  485     protected function _loadFromDb($sType, $sId, $iLang, $iShopId = null, $sParams = null, $blStrictParamsCheck = 
true)
 
  488         if ($iShopId === null) {
 
  489             $iShopId = $this->
getConfig()->getShopId();
 
  492         $iLang = (int) $iLang;
 
  502             WHERE `oxtype` = " . $oDb->quote($sType) . 
" 
  503                AND `oxobjectid` = " . $oDb->quote($sId) . 
" 
  504                AND `oxshopid` = " . $oDb->quote($iShopId) . 
" 
  505                AND `oxlang` = '{$iLang}'";
 
  507         $sParams = $sParams ? $sParams : 
'';
 
  508         if ($sParams && $blStrictParamsCheck) {
 
  509             $sQ .= 
" AND `oxparams` = '{$sParams}'";
 
  511             $sQ .= 
" ORDER BY `oxparams` ASC";
 
  520         if (($sSeoUrl = $this->
_loadFromCache($sIdent, $sType, $iLang, $iShopId, $sParams)) === 
false) {
 
  521             $oRs = $oDb->select($sQ);
 
  523             if ($oRs && $oRs->recordCount() > 0 && !$oRs->EOF) {
 
  525                 if ($oRs->fields[
'oxexpired'] && ($oRs->fields[
'oxtype'] == 
'static' || $oRs->fields[
'oxtype'] == 
'dynamic')) {
 
  528                     $oDb->execute(
"update oxseo set oxexpired = 0 where oxobjectid = " . $oDb->quote($sId) . 
" and oxlang = '{$iLang}'");
 
  529                     $sSeoUrl = $oRs->fields[
'oxseourl'];
 
  530                 } elseif (!$oRs->fields[
'oxexpired'] || $oRs->fields[
'oxfixed']) {
 
  532                     $sSeoUrl = $oRs->fields[
'oxseourl'];
 
  536                 $this->
_saveInCache($sIdent, $sSeoUrl, $sType, $iLang, $iShopId, $sParams);
 
  551         if (!isset(self::$_aReservedEntryKeys) || !is_array(self::$_aReservedEntryKeys)) {
 
  552             $sDir = getShopBasePath();
 
  553             self::$_aReservedEntryKeys = array_map(
'preg_quote', self::$_aReservedWords, array(
'#'));
 
  555             foreach (glob(
"$sDir/*") as $sFile) {
 
  556                 if ($oStr->preg_match(
'/^(.+)\.php[0-9]*$/i', basename($sFile), $aMatches)) {
 
  557                     self::$_aReservedEntryKeys[] = preg_quote($aMatches[0], 
'#');
 
  558                     self::$_aReservedEntryKeys[] = preg_quote($aMatches[1], 
'#');
 
  559                 } elseif (is_dir($sFile)) {
 
  560                     self::$_aReservedEntryKeys[] = preg_quote(basename($sFile), 
'#');
 
  563             self::$_aReservedEntryKeys = array_unique(self::$_aReservedEntryKeys);
 
  584         $sUri = $oStr->strip_tags($sUri);
 
  588         if ($sExt === null) {
 
  590             if ($oStr->preg_match(
'/(\.html?|\/)$/i', $sUri, $aMatched)) {
 
  591                 $sExt = $aMatched[0];
 
  596         if ($sExt && $oStr->substr($sUri, 0 - $oStr->strlen($sExt)) == $sExt) {
 
  597             $sUri = $oStr->substr($sUri, 0, $oStr->strlen($sUri) - $oStr->strlen($sExt));
 
  603         if (!$sUri && self::$_sPrefix) {
 
  604             $sUri = $this->
_prepareUri(self::$_sPrefix, $iLang);
 
  608         if (
'/' != self::$_sSeparator) {
 
  610             $sUri = trim($sUri, self::$_sSeparator);
 
  619         $sUri = $oStr->preg_replace(
"#^(/*)(" . implode(
'|', $this->
_getReservedEntryKeys()) . 
")(/|$)#i", 
"\$1\$2$sAdd\$3", $sUri);
 
  624         if (phpversion() < 
'5.3') {
 
  625             $sQuotedSeparator = str_replace(
'-', 
'\-', $sQuotedSeparator);
 
  628         return $oStr->preg_replace(
 
  629             array(
'|//+|', 
'/' . $sQuotedSeparator . $sQuotedSeparator . 
'+/'),
 
  630             array(
'/', self::$_sSeparator), $sUri
 
  644     protected function _prepareTitle($sTitle, $blSkipTruncate = 
false, $iLang = 
false)
 
  648         if (!$sSep || (
'/' == $sSep)) {
 
  652         $sRegExp = 
'/[^A-Za-z0-9\/' . preg_quote(self::$_sPrefix, 
'/') . preg_quote($sSep, 
'/') . 
']+/';
 
  653         $sTitle = preg_replace(array(
"#/+#", $sRegExp, 
"# +#", 
"#(" . preg_quote($sSep, 
'/') . 
")+#"), $sSep, $sTitle);
 
  658             $iFirstSpace = $oStr->strpos($sTitle, $sSep, $this->_iIdLength);
 
  659             if ($iFirstSpace !== 
false) {
 
  660                 $sTitle = $oStr->substr($sTitle, 0, $iFirstSpace);
 
  664         $sTitle = trim($sTitle, $sSep);
 
  691     protected function _saveToDb($sType, $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId = null, $blFixed = null, $sParams = null)
 
  694         if ($iShopId === null) {
 
  695             $iShopId = $this->
getConfig()->getShopId();
 
  698         $iLang = (int) $iLang;
 
  700         $sStdUrl = $this->
_trimUrl($sStdUrl);
 
  701         $sSeoUrl = $this->
_trimUrl($sSeoUrl);
 
  705         $sQtedObjectId = $oDb->quote($sObjectId);
 
  706         $iQtedShopId = $oDb->quote($iShopId);
 
  707         $sQtedType = $oDb->quote($sType);
 
  708         $sQtedSeoUrl = $oDb->quote($sSeoUrl);
 
  709         $sQtedStdUrl = $oDb->quote($sStdUrl);
 
  710         $sQtedParams = $oDb->quote($sParams);
 
  711         $sQtedIdent = $oDb->quote($sIdent);
 
  714         $sQ = 
"select oxfixed, oxexpired, ( oxstdurl like {$sQtedStdUrl} ) as samestdurl, 
  715                 oxseourl like {$sQtedSeoUrl} as sameseourl from oxseo where oxtype = {$sQtedType} and 
  716                 oxobjectid = {$sQtedObjectId} and oxshopid = {$iQtedShopId}  and oxlang = {$iLang} ";
 
  718         $sQ .= $sParams ? 
" and oxparams = {$sQtedParams} " : 
'';
 
  721         $oRs = $oDb->select($sQ);
 
  722         if ($oRs && $oRs->recordCount() > 0 && !$oRs->EOF) {
 
  723             if ($oRs->fields[
'samestdurl'] && $oRs->fields[
'sameseourl'] && $oRs->fields[
'oxexpired']) {
 
  725                 $sFixed = isset($blFixed) ? 
", oxfixed = " . ((int) $blFixed) . 
" " : 
'';
 
  727                 $sSql = 
"update oxseo set oxexpired = 0 {$sFixed} where oxtype = {$sQtedType} and 
  728                           oxobjectid = {$sQtedObjectId} and oxshopid = {$iQtedShopId} and oxlang = {$iLang} ";
 
  729                 $sSql .= $sParams ? 
" and oxparams = {$sQtedParams} " : 
'';
 
  732                 return $oDb->execute($sSql);
 
  733             } elseif ($oRs->fields[
'oxexpired']) {
 
  740         $sParams = $sParams ? $oDb->quote($sParams) : 
'""';
 
  741         $blFixed = (int) $blFixed;
 
  743         $sQ = 
"insert into oxseo 
  744                     (oxobjectid, oxident, oxshopid, oxlang, oxstdurl, oxseourl, oxtype, oxfixed, oxexpired, oxparams) 
  746                     ( {$sQtedObjectId}, {$sQtedIdent}, {$iQtedShopId}, {$iLang}, {$sQtedStdUrl}, {$sQtedSeoUrl}, {$sQtedType}, '$blFixed', '0', {$sParams} ) 
  747                 on duplicate key update 
  748                     oxident = {$sQtedIdent}, oxstdurl = {$sQtedStdUrl}, oxseourl = {$sQtedSeoUrl}, oxfixed = '$blFixed', oxexpired = '0'";
 
  750         return $oDb->execute($sQ);
 
  767         $sUrl = str_replace(array(
$myConfig->getShopUrl($iLang, 
false), 
$myConfig->getSslShopUrl($iLang)), 
'', $sUrl);
 
  768         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\.]+&?(amp;)?/i', 
'\1', $sUrl);
 
  769         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)shp=[0-9]+&?(amp;)?/i', 
'\1', $sUrl);
 
  770         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)lang=[0-9]+&?(amp;)?/i', 
'\1', $sUrl);
 
  771         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)cur=[0-9]+&?(amp;)?/i', 
'\1', $sUrl);
 
  772         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)stoken=[a-z0-9]+&?(amp;)?/i', 
'\1', $sUrl);
 
  773         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)&(amp;)?/i', 
'\1', $sUrl);
 
  774         $sUrl = $oStr->preg_replace(
'/(\?|&(amp;)?)+$/i', 
'', $sUrl);
 
  779         if ($oStr->strlen($sUrl) > $iLength) {
 
  780             $sUrl = $oStr->substr($sUrl, 0, $iLength);
 
  793         if ($this->_iMaxUrlLength === null) {
 
  795             $this->_iMaxUrlLength = $this->
getConfig()->getConfigParam(
"iMaxSeoUrlLength");
 
  796             if (!$this->_iMaxUrlLength) {
 
  797                 $this->_iMaxUrlLength = 2048;
 
  813     public function encodeString($sString, $blReplaceChars = 
true, $iLang = 
false)
 
  816         $sString = 
getStr()->html_entity_decode($sString);
 
  818         if ($blReplaceChars) {
 
  819             if ($iLang === 
false || !is_numeric($iLang)) {
 
  824                 $sString = str_replace(array_keys($aReplaceChars), array_values($aReplaceChars), $sString);
 
  830         $aReplaceWhat = array(
'&', 
'"', 
''', 
'<', 
'>');
 
  832         return str_replace($aReplaceWhat, 
'', $sString);
 
  842         self::$_sSeparator = $sSeparator;
 
  843         if (!self::$_sSeparator) {
 
  844             self::$_sSeparator = 
'-';
 
  856             self::$_sPrefix = $sPrefix;
 
  858             self::$_sPrefix = 
'oxid';
 
  869         if (isset($iIdlength)) {
 
  870             $this->_iIdLength = $iIdlength;
 
  882         self::$_aReservedWords = array_merge(self::$_aReservedWords, $aReservedWords);
 
  895     public function markAsExpired($sId, $iShopId = null, $iExpStat = 1, $iLang = null, $sParams = null)
 
  898         $sWhere = $sId ? 
"where oxobjectid =  " . $oDb->quote($sId) : 
'';
 
  899         $sWhere .= isset($iShopId) ? ($sWhere ? 
" and oxshopid = " . $oDb->quote($iShopId) : 
"where oxshopid = " . $oDb->quote($iShopId)) : 
'';
 
  900         $sWhere .= !is_null($iLang) ? ($sWhere ? 
" and oxlang = '{$iLang}'" : 
"where oxlang = '{$iLang}'") : 
'';
 
  901         $sWhere .= $sParams ? ($sWhere ? 
" and {$sParams}" : 
"where {$sParams}") : 
'';
 
  903         $sQ = 
"update oxseo set oxexpired =  " . $oDb->quote($iExpStat) . 
" $sWhere ";
 
  920     protected function _getPageUri($oObject, $sType, $sStdUrl, $sSeoUrl, $sParams, $iLang = null, $blFixed = 
false)
 
  922         if (!isset($iLang)) {
 
  923             $iLang = $oObject->getLanguage();
 
  925         $iShopId = $this->
getConfig()->getShopId();
 
  928         $sOldSeoUrl = $this->
_loadFromDb($sType, $oObject->getId(), $iLang, $iShopId, $sParams);
 
  931             $sSeoUrl = $this->
_processSeoUrl($sSeoUrl, $oObject->getId(), $iLang);
 
  932             $this->
_saveToDb($sType, $oObject->getId(), $sStdUrl, $sSeoUrl, $iLang, $iShopId, (int) $blFixed, $sParams);
 
  935             $sSeoUrl = $sOldSeoUrl;
 
  951         return md5(strtolower($iShopId . $this->
_trimUrl($sStdUrl)));
 
  967         $sOldObjectId = null;
 
  970         $sStdUrl = $this->
_trimUrl(trim($aStaticUrl[
'oxseo__oxstdurl']));
 
  971         $sObjectId = $aStaticUrl[
'oxseo__oxobjectid'];
 
  973         if (!$sObjectId || $sObjectId == 
'-1') {
 
  977             $sOldObjectId = $sObjectId;
 
  985         foreach ($aStaticUrl[
'oxseo__oxseourl'] as $iLang => $sSeoUrl) {
 
  987             $iLang = (int) $iLang;
 
  990             $sSeoUrl = $this->
_trimUrl($sSeoUrl);
 
  998                 if (!$oDb->getOne(
"select (" . $oDb->quote($sSeoUrl) . 
" like oxseourl) & (" . $oDb->quote($sStdUrl) . 
" like oxstdurl) from oxseo where oxobjectid = " . $oDb->quote($sOldObjectId) . 
" and oxshopid = '{$iShopId}' and oxlang = '{$iLang}' ", 
false, 
false)) {
 
  999                     $this->
_copyToHistory($sOldObjectId, $iShopId, $iLang, 
'static', $sObjectId);
 
 1003             if (!$sSeoUrl || !$sStdUrl) {
 
 1013             $sValues .= 
"( " . $oDb->quote($sObjectId) . 
", " . $oDb->quote($sIdent) . 
", " . $oDb->quote($iShopId) . 
", '{$iLang}', " . $oDb->quote($sStdUrl) . 
", " . $oDb->quote($sSeoUrl) . 
", 'static' )";
 
 1017         if ($sOldObjectId) {
 
 1018             $oDb->execute(
"delete from oxseo where oxobjectid in ( " . $oDb->quote($sOldObjectId) . 
", " . $oDb->quote($sObjectId) . 
" )");
 
 1024             $sQ = 
"insert into oxseo ( oxobjectid, oxident, oxshopid, oxlang, oxstdurl, oxseourl, oxtype ) values {$sValues} ";
 
 1038         $iBaseShopId = $this->
getConfig()->getBaseShopId();
 
 1039         if ($iShopId != $iBaseShopId) {
 
 1042                 $sQ = 
"insert into oxseo ( oxobjectid, oxident, oxshopid, oxlang, oxstdurl, oxseourl, oxtype ) 
 1043                        select MD5( LOWER( CONCAT( " . $oDb->quote($iShopId) . 
", oxstdurl ) ) ), MD5( LOWER( oxseourl ) ), 
 1044                        " . $oDb->quote($iShopId) . 
", oxlang, oxstdurl, oxseourl, oxtype from oxseo where oxshopid = '{$iBaseShopId}' and oxtype = 'static' and oxlang='$iLang' ";
 
 1061         if (!isset($iShopId)) {
 
 1062             $iShopId = $this->
getConfig()->getShopId();
 
 1064         if (!isset($iLang)) {
 
 1068         if (isset($this->_aStaticUrlCache[$sStdUrl][$iLang][$iShopId])) {
 
 1069             return $this->_aStaticUrlCache[$sStdUrl][$iLang][$iShopId];
 
 1073         if (($sSeoUrl = $this->
_getStaticUri($sStdUrl, $iShopId, $iLang))) {
 
 1074             $sFullUrl = $this->
_getFullUrl($sSeoUrl, $iLang, strpos($sStdUrl, 
"https:") === 0);
 
 1078         $this->_aStaticUrlCache[$sStdUrl][$iLang][$iShopId] = $sFullUrl;
 
 1099     public function addSeoEntry($sObjectId, $iShopId, $iLang, $sStdUrl, $sSeoUrl, $sType, $blFixed = 1, $sKeywords = 
'', $sDescription = 
'', $sParams = 
'', $blExclude = 
false, $sAltObjectId = null)
 
 1101         $sSeoUrl = $this->
_processSeoUrl($this->
_trimUrl($sSeoUrl ? $sSeoUrl : $this->
_getAltUri($sAltObjectId ? $sAltObjectId : $sObjectId, $iLang)), $sObjectId, $iLang, $blExclude);
 
 1102         if ($this->
_saveToDb($sType, $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId, $blFixed, $sParams)) {
 
 1107             $sQtedObjectId = $oDb->quote($sAltObjectId ? $sAltObjectId : $sObjectId);
 
 1108             $iQtedShopId = $oDb->quote($iShopId);
 
 1111             if ($sKeywords !== 
false) {
 
 1112                 $sKeywords = $oDb->quote($oStr->htmlspecialchars($this->encodeString($oStr->strip_tags($sKeywords), 
false, $iLang)));
 
 1115             if ($sDescription !== 
false) {
 
 1116                 $sDescription = $oDb->quote($oStr->htmlspecialchars($oStr->strip_tags($sDescription)));
 
 1119             $sQ = 
"insert into oxobject2seodata 
 1120                        ( oxobjectid, oxshopid, oxlang, oxkeywords, oxdescription ) 
 1122                        ( {$sQtedObjectId}, {$iQtedShopId}, {$iLang}, " . ($sKeywords ? $sKeywords : 
"''") . 
", " . ($sDescription ? $sDescription : 
"''") . 
" ) 
 1123                    on duplicate key update 
 1124                        oxkeywords = " . ($sKeywords ? $sKeywords : 
"oxkeywords") . 
", oxdescription = " . ($sDescription ? $sDescription : 
"oxdescription");
 
 1150         $sQ = 
"delete from oxseo where oxobjectid = " . $oDb->quote($sObjectId) . 
" and oxshopid = " . $oDb->quote($iShopId) . 
" and oxlang = " . $oDb->quote($iLang) . 
" and oxtype = " . $oDb->quote($sType) . 
" ";
 
 1164     public function getMetaData($sObjectId, $sMetaType, $iShopId = null, $iLang = null)
 
 1168         $iShopId = (!isset($iShopId)) ? $this->
getConfig()->getShopId() : $iShopId;
 
 1169         $iLang = (!isset($iLang)) ? 
oxRegistry::getLang()->getObjectTplLanguage() : ((int) $iLang);
 
 1171         return $oDb->getOne(
"select {$sMetaType} from oxobject2seodata where oxobjectid = " . $oDb->quote($sObjectId) . 
" and oxshopid = " . $oDb->quote($iShopId) . 
" and oxlang = '{$iLang}'");
 
 1189         startProfile(
"getDynamicUrl");
 
 1190         $sDynUrl = $this->
_getFullUrl($this->
_getDynamicUri($sStdUrl, $sSeoUrl, $iLang), $iLang, strpos($sStdUrl, 
"https:") === 0);
 
 1191         stopProfile(
"getDynamicUrl");
 
 1207         $iLanguage = isset($iLanguage) ? ((int) $iLanguage) : 
oxRegistry::getLang()->getBaseLanguage();
 
 1210         $sShopId = $this->
getConfig()->getShopId();
 
 1212         $sQ = 
"SELECT `oxseourl`, `oxlang` FROM `oxseo` WHERE `oxstdurl` = " . $oDb->quote($sStdUrl) . 
" AND `oxlang` = '$iLanguage' AND `oxshopid` = '$sShopId' LIMIT 1";
 
 1215         $oRs = $oDb->select($sQ);
 
 1218             $sSeoUrl = $oRs->fields[
'oxseourl'];
 
 1233         if (!is_string($sStringWithSpecialChars)) {
 
 1238         $sQuotedPrefix = preg_quote(self::$_sSeparator . self::$_sPrefix, 
'/');
 
 1239         if (phpversion() < 
'5.3') {
 
 1240             $sQuotedPrefix = str_replace(
'-', 
'\-', $sQuotedPrefix);
 
 1242         $sRegExp = 
'/[^A-Za-z0-9' . $sQuotedPrefix . 
'\/]+/';
 
 1243         $sanitized = $oStr->preg_replace(
 
 1244             array(
"/\W*\/\W*/", $sRegExp),
 
 1245             array(
"/", self::$_sSeparator),
 
 1246             $sStringWithSpecialChars