Moves safeSQL function to utils
This commit is contained in:
parent
b84cf93f4a
commit
660c739c18
1 changed files with 7 additions and 6 deletions
13
kb
13
kb
|
@ -67,6 +67,13 @@ isInt() {
|
||||||
return "$?"
|
return "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Escapes ' and \ characters
|
||||||
|
safeSQL(){
|
||||||
|
echo "$1" |
|
||||||
|
sed 's/\\/\\\\/g' |
|
||||||
|
sed "s/'/\\\'/g"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Set Flags
|
# Set Flags
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
|
@ -124,12 +131,6 @@ makedb(){
|
||||||
echo "Still need to implement this"
|
echo "Still need to implement this"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Escapes ' and \ characters
|
|
||||||
safeSQL(){
|
|
||||||
echo "$1" |
|
|
||||||
sed 's/\\/\\\\/g' |
|
|
||||||
sed "s/'/\\\'/g"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Makes file names safe
|
# Makes file names safe
|
||||||
escapeFilename(){
|
escapeFilename(){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue