src/Common/Event/Listener/Locale/Detect.php
protected function parseUrl(string $sUrl): \stdClass
    {
        preg_match($this->oLocaleService->getUrlRegex(), $sUrl, $aMatches);

        $sLanguage   = !empty($aMatches[1]) ? $aMatches[1] : '';
        $sRequestUrl = !empty($aMatches[3]) ? $aMatches[3] : '';
        $aRequestUrl = parse_url($sRequestUrl);

        $sPath  = ltrim(!empty($aRequestUrl['path']) ? $aRequestUrl['path'] : '', '/');
        $sQuery = !empty($aRequestUrl['query']) ? $aRequestUrl['query'] : '';

        return (object) [
            'language' => !empty($aMatches[1]) ? $aMatches[1] : null,
            'path'     => $sPath,
            'query'    => $sQuery,
            'url'      => $sPath . ($sQuery ? '?' . $sQuery : ''),
        ];
    }
protected function parseUrl(string $sUrl): \stdClass
    {
        preg_match($this->oLocaleService->getUrlRegex(), $sUrl, $aMatches);

        $sLanguage   = !empty($aMatches[1]) ? $aMatches[1] : '';
        $sRequestUrl = !empty($aMatches[3]) ? $aMatches[3] : '';
        $aRequestUrl = parse_url($sRequestUrl);

        $sPath  = ltrim(!empty($aRequestUrl['path']) ? $aRequestUrl['path'] : '', '/');
        $sQuery = !empty($aRequestUrl['query']) ? $aRequestUrl['query'] : '';

        return (object) [
            'language' => !empty($aMatches[1]) ? $aMatches[1] : null,
            'path'     => $sPath,
            'query'    => $sQuery,
            'url'      => $sPath . ($sQuery ? '?' . $sQuery : ''),
        ];
    }
protected function parseUrl ( string $ sUrl ) : \ stdClass { preg_match ( $ this -> oLocaleService -> getUrlRegex ( ) , $ sUrl , $ aMatches ) ; $ sLanguage = ! empty ( $ aMatches [ 1 ] ) ? $ aMatches [ 1 ] : '' ; $ sRequestUrl = ! empty ( $ aMatches [ 3 ] ) ? $ aMatches [ 3 ] : '' ; $ aRequestUrl = parse_url ( $ sRequestUrl ) ; $ sPath = ltrim ( ! empty ( $ aRequestUrl [ 'path' ] ) ? $ aRequestUrl [ 'path' ] : '' , '/' ) ; $ sQuery = ! empty ( $ aRequestUrl [ 'query' ] ) ? $ aRequestUrl [ 'query' ] : '' ; return ( object ) [ 'language' => ! empty ( $ aMatches [ 1 ] ) ? $ aMatches [ 1 ] : null , 'path' => $ sPath , 'query' => $ sQuery , 'url' => $ sPath . ( $ sQuery ? '?' . $ sQuery : '' ) , ] ; }
Parse the URL for supported languages

@param string $sUrl The URL to parse

@return \stdClass
Parse the URL for supported languages