// first, uncheck any checkboxes and select options // $sFormBuf = UnCheckStuff($sFormBuf); foreach ($aDataArray as $sName => $sValue) { // $sName = StripGPC($sName); // probably not needed //$aDebug[] = "Name='$sName', type=".gettype($sValue); if (is_array($sValue)) { // // note that if no values are selected for a field, // then we will never get here for that field // $sFormBuf = FixCheckboxes($sName, $sValue, $sFormBuf); $sFormBuf = FixMultiSelect($sName, $sValue, $sFormBuf); } else { if ($bStripData) { $sValue = StripGPC($sValue); } // // Fix the field if it's an input type "text" or "password". // $sFormBuf = FixInputText($sName, $sValue, $sFormBuf); // // Fix the field if it's radio button. // $sFormBuf = FixButton($sName, $sValue, $sFormBuf); // // Fix the field if it's a "textarea". // $sFormBuf = FixTextArea($sName, $sValue, $sFormBuf); // // Fix the field if it's a "select".
function Strip($value, $b_conv_quotes = true) { $value = StripGPC($value); if ($b_conv_quotes) { // // "standard" quote conversion // $value = str_replace("\"", "'", $value); } $value = preg_replace('/[[:cntrl:][:space:]]+/', " ", $value); // zap all control chars and multiple blanks return $value; }