public static function getCurrentUrl()
    {
        //former $TSFE->anchorPrefix got deprecated in TYPO3 7.x
        $tsfeAnchorPrefix = Typo3GeneralUtility::getIndpEnv('TYPO3_SITE_SCRIPT');

        if ($tsfeAnchorPrefix !== false && !empty($tsfeAnchorPrefix)) {
            return $tsfeAnchorPrefix;
        } else {
            return (string) self::getTsfe()->siteScript;
        }
    }