Name

makedbsafe — try to make the returned string safe for use in the database

Synopsis

use Wacs;
scalar makedbsafe(...); 
 

Parameters

parameterdescription
stringthe string of text to be considered
allowcharacters to allow which are not normally acceptable: at present only forward slash (/) is recognised
denycharacters to deny which are normal acceptable: at present any space character (space, tab, newline) given here will cause any whitespace characters to be stripped out.

Summary

The makedbsafe function is designed to remove characters which are unsuitable for feeding to the database. It normally works with a default set of rules, which implicitly disallows forward slash (but this can be explicity allowed with allow=>'/'). Similarly white space can be removed from a file name when required using the deny option.

Availability

makedbsafe is available in both php and perl. This function was added in Wacs 0.8.1.