public function prepareCanonicalUrl($sUrl)
    {
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */
        $oStr = getStr();

        // cleaning up session id..
        $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\._]+&?(amp;)?/i', '\1', $sUrl);
        $sUrl = $oStr->preg_replace('/(&amp;|\?)$/', '', $sUrl);
        $sSep = ($oStr->strpos($sUrl, '?') === false) ? '?' : '&amp;';

        if (!\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) {
            // non seo url has no language identifier..
            $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
            if (!$oStr->preg_match('/[&?](amp;)?lang=[0-9]+/i', $sUrl) &&
                $iLang != $oConfig->getConfigParam('sDefaultLang')
            ) {
                $sUrl .= "{$sSep}lang=" . $iLang;
            }
        }

        return $sUrl;
    }