Barebone\GUI\Filter-Var

You might know this situation. In some code you find a $_POST or $_GET variable without filtering or validation.

$UserID = $_POST['UserID'];

Refactoring this to filer_input() an filter_var() is quite a hasle. You have to deal with all sort of options and remember all php filter contstants.

Not with Barebone GUI. Select the code in the editor and press button in the toolbar. This will open a dialog where you can set the filter an validation. In the first tab (Sanitizers) you will see:

  • the selected element in the editor
  • The filter
  • If any flag apply to the filter you will see these

In the second tab (Validators) you will see:

  • the selected element in the editor
  • The validator
  • If any flag apply to the filter you will see these
  • Options of the validator
  • Options RegEX validator

In the third tab (Code) you will see the code that will be generated and replace your selection. There are also comments that explain what happens