2

Is safe to access to $_SERVER['DOCUMENT_ROOT'] directly without filtering functions like filter_input()?

Joy
  • 267
  • 1
  • 4
  • 13

1 Answers1

8

filter_input() ?

There is no input in $_SERVER['DOCUMENT_ROOT'], that is a server controlled property and can not be manipulated ordinarily by user input so no need to filter it using that method.

Unless you think your server is compromised that is :) in which case it will be useless to filter for anything at all.

Hanky Panky
  • 46,730
  • 8
  • 72
  • 95