Skip to content

Instantly share code, notes, and snippets.

@0xffhh
Last active March 25, 2020 15:31
Show Gist options
  • Save 0xffhh/c65f44be31ea49d5feaf22b00a96912b to your computer and use it in GitHub Desktop.
Save 0xffhh/c65f44be31ea49d5feaf22b00a96912b to your computer and use it in GitHub Desktop.
sub IsSafe {
#http://sleep.dashnine.org/manual/index.html
local('$pos');
@badchars = @(";", "&", '$', "'");
foreach $index => $value (@badchars)
{
$pos = indexOf($1, $value);
if (-isnumber $pos)
{
println("Invalid char detected");
return 0;
}
}
println("String is safe");
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment