function PMA_cleanupPathInfo()
{
    global $PMA_PHP_SELF, $_PATH_INFO;

    $PMA_PHP_SELF = PMA_getenv('PHP_SELF');
    $_PATH_INFO = PMA_getenv('PATH_INFO');
    if (! empty($_PATH_INFO) && ! empty($PMA_PHP_SELF)) {
        $path_info_pos = mb_strrpos($PMA_PHP_SELF, $_PATH_INFO);
        $pathLength = $path_info_pos + mb_strlen($_PATH_INFO);
        if ($pathLength === mb_strlen($PMA_PHP_SELF)) {
            $PMA_PHP_SELF = mb_substr($PMA_PHP_SELF, 0, $path_info_pos);
        }
    }
    $PMA_PHP_SELF = htmlspecialchars($PMA_PHP_SELF);
}
Software security is not security software. Here we're concerned with topics like authentication, access control, confidentiality, cryptography, and privilege management.