fixed superglobal name and substr() usage in Request