[Overview][Constants][Procedures and functions] | Reference for unit 'pwumain' (#powtils_main) |
Source position: pwumain.pas line 66
function GetCgiVar_S( |
const name: String; |
const SecureLevel: Integer |
):String; |
The _S suffix stands for "specify security". The underscore, S, and zero was purposely used to jump out and scare anyone reading the code.
You should filter or check the data after calling this function, such as using the FilterHtml function, or your custom one.
http://site.com/cgi-bin/test.cgi?var=<b>hi</b>Note that somebody has inserted the bold <b> tags into your URL! This could be dangerous, since:
var tmp: string; begin tmp:= GetCgiVar_S('var', 0); webwrite(tmp); //prints hi in bold! unfiltered, insecure! raw data end.Using your own filtering:
var tmp: string; begin tmp:= GetCgiVar_S('var', 0); YourFilter(tmp); // this is your security webwrite(tmp); end.