Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acf-weblog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACF
acf-weblog
Commits
ed757db9
Commit
ed757db9
authored
Jan 03, 2012
by
Ted Trask
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed escape function to not escape \
parent
682f6095
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
weblog-model.lua
weblog-model.lua
+4
-5
No files found.
weblog-model.lua
View file @
ed757db9
...
...
@@ -62,8 +62,7 @@ end
local
escape
=
function
(
sql
,
length
)
sql
=
sql
or
""
if
length
then
sql
=
string.sub
(
sql
,
1
,
length
)
end
sql
=
string.gsub
(
sql
,
"'"
,
"''"
)
return
string.gsub
(
sql
,
"
\\
"
,
"
\\\\
"
)
return
string.gsub
(
sql
,
"'"
,
"''"
)
end
-- List the postgres databases on this system
...
...
@@ -397,7 +396,7 @@ end
local
testdatabaseentry
=
function
(
datatype
,
value
)
local
success
=
true
local
errtxt
local
sql
=
"CREATE TEMP TABLE testing ( test "
..
escape
(
datatype
)
..
" DEFAULT '"
..
escape
(
value
)
..
"' ) ON COMMIT DROP"
local
sql
=
"CREATE TEMP TABLE testing ( test "
..
datatype
..
" DEFAULT '"
..
escape
(
value
)
..
"' ) ON COMMIT DROP"
local
res
,
err
=
pcall
(
function
()
assert
(
con
:
execute
(
sql
))
end
)
...
...
@@ -413,9 +412,9 @@ local convertdatabaseentry = function(datatype, value)
local
errtxt
local
result
=
value
local
res
,
err
=
pcall
(
function
()
local
sql
=
"CREATE TEMP TABLE testing ( test "
..
escape
(
datatype
)
..
" )"
local
sql
=
"CREATE TEMP TABLE testing ( test "
..
datatype
..
" )"
assert
(
con
:
execute
(
sql
))
sql
=
"INSERT INTO testing VALUES ('"
..
value
..
"')"
sql
=
"INSERT INTO testing VALUES ('"
..
escape
(
value
)
..
"')"
assert
(
con
:
execute
(
sql
))
sql
=
"SELECT * FROM testing"
local
cur
=
assert
(
con
:
execute
(
sql
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment