Symfony\Component\HttpFoundation\Request::getUrlencodedPrefix PHP Method

getUrlencodedPrefix() private method

* Returns the prefix as encoded in the string when the string starts with the given prefix, false otherwise.
private getUrlencodedPrefix ( $string, $prefix )
$string The urlencoded string
$prefix The prefix not encoded
    private function getUrlencodedPrefix($string, $prefix)
    {
        if (0 !== strpos(rawurldecode($string), $prefix)) {
            return false;
        }

        $len = strlen($prefix);

        if (preg_match(sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) {
            return $match[0];
        }

        return false;
    }