Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional xss protection #56

Open
16 opened this issue Aug 27, 2018 · 0 comments
Open

Add optional xss protection #56

16 opened this issue Aug 27, 2018 · 0 comments

Comments

@16
Copy link
Collaborator

16 commented Aug 27, 2018

See : https://github.com/yesinteractive/fsl/blob/master/lib/fsl.php#L1136
Something like this…:

function request_uri($env=null)
{
   static $uri = null;
   if(is_null($env))
   {
      if(!is_null($uri)) return $uri;
      $env = env();
    }
   // retrieve $uri depending env
   $uri = rawurldecode(xss_filter($uri));  // store in static $uri variable
   return $uri;
}

if(!defined('xss_filter'))
{
   function xss_filter($str)
   {
        // minimal filtering like https://stackoverflow.com/a/1741568
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant