diff --git a/src/lua/endpoints/index_get.lua b/src/lua/endpoints/index_get.lua
index 2c3fdbc..32ced5e 100644
--- a/src/lua/endpoints/index_get.lua
+++ b/src/lua/endpoints/index_get.lua
@@ -26,7 +26,6 @@ local function get_site_home(req)
stmnt_index:bind_names{}
local latest = {}
for idr, title, iar, dater, author, hits in util.sql_rows(stmnt_index) do
- print("got:",tagsr,idr,title,iar,dater,author)
table.insert(latest,{
url = util.encode_id(idr),
title = title,
diff --git a/src/lua/endpoints/paste_get.lua b/src/lua/endpoints/paste_get.lua
index 0988ebd..5e46475 100644
--- a/src/lua/endpoints/paste_get.lua
+++ b/src/lua/endpoints/paste_get.lua
@@ -9,7 +9,6 @@ local function paste_get(req)
local text
local author,_ = session.get(req)
if host == config.domain and author then
- print("host:",host,"config.domain:",config.domain,"author:",author)
http_response_header(req,"Location",string.format("https://%s.%s/_paste",author,config.domain))
http_response(req,303,"")
return
@@ -30,7 +29,6 @@ local function paste_get(req)
text="",
})
elseif host ~= config.domain and author == nil then
- print("host:",host,"config.domain:",config.domain,"author:",author)
http_response_header(req,"Location",string.format("https://%s/_paste",config.domain))
http_response(req,303,"")
return
diff --git a/src/lua/endpoints/paste_post.lua b/src/lua/endpoints/paste_post.lua
index 0c84d8c..5ab3c41 100644
--- a/src/lua/endpoints/paste_post.lua
+++ b/src/lua/endpoints/paste_post.lua
@@ -43,16 +43,23 @@ local function anon_paste(req,ps)
stmnt_paste:reset()
if err == sql.DONE then
local rowid = stmnt_paste:last_insert_rowid()
+ local url = util.encode_id(rowid)
assert(stmnt_raw:bind(1,rowid) == sql.OK)
assert(stmnt_raw:bind_blob(2,ps.raw) == sql.OK)
assert(stmnt_raw:bind(3,ps.markup) == sql.OK)
err = util.do_sql(stmnt_raw)
stmnt_raw:reset()
if err ~= sql.DONE then
- print("Failed to save raw text, but paste still went though")
+ local msg = string.format(
+ [[Failed to save raw text for %d(%s) but paste still went though: %d: %s]],
+ rowid,
+ url,
+ err,
+ db.conn:errmsg()
+ )
+ log(LOG_CRIT,msg)
end
tags.set(rowid,ps.tags)
- local url = util.encode_id(rowid)
local loc = string.format("https://%s/%s",config.domain,url)
http_response_header(req,"Location",loc)
http_response(req,303,"")
@@ -60,7 +67,7 @@ local function anon_paste(req,ps)
cache.dirty(string.format("%s",config.domain))
return
elseif err == sql.ERROR or err == sql.MISUSE then
- ret = "Failed to paste: " .. tostring(err)
+ error("Failed to paste:" .. tostring(err))
else
error("Error pasting:" .. tostring(err))
end
@@ -90,16 +97,23 @@ local function author_paste(req,ps)
stmnt_paste:reset()
if err == sql.DONE then
local rowid = stmnt_paste:last_insert_rowid()
+ local url = util.encode_id(rowid)
assert(stmnt_raw:bind(1,rowid) == sql.OK)
assert(stmnt_raw:bind_blob(2,ps.raw) == sql.OK)
assert(stmnt_raw:bind(3,ps.markup) == sql.OK)
err = util.do_sql(stmnt_raw)
stmnt_raw:reset()
if err ~= sql.DONE then
- print("Failed to save raw text, but paste still went through")
+ local msg = string.format(
+ [[Failed to save raw text for %d(%s) but paste still went though: %d: %s]],
+ rowid,
+ url,
+ err,
+ db.conn:errmsg()
+ )
+ log(LOG_CRIT,msg)
end
tags.set(rowid,ps.tags)
- local url = util.encode_id(rowid)
local loc
if asanon == "anonymous" then
loc = string.format("https://%s/%s",config.domain,url)
@@ -113,7 +127,7 @@ local function author_paste(req,ps)
cache.dirty(string.format("%s",config.domain))
return
elseif err == sql.ERROR or err == sql.MISUSE then
- ret = "Failed to paste: " .. tostring(err)
+ error("Failed to paste: " .. tostring(err) .. " : " .. db.conn:errmsg())
else
error("Error pasting:",err)
end
diff --git a/src/lua/parser_imageboard.lua b/src/lua/parser_imageboard.lua
index 2d8902a..2ecff09 100644
--- a/src/lua/parser_imageboard.lua
+++ b/src/lua/parser_imageboard.lua
@@ -96,44 +96,16 @@ local grammar = P{
marked = V"spoiler" + V"bold" + V"italic" + V"underline" + V"heading" + V"strike" + V"spoiler2" + V"code",
plainline = (V"marked" + word)^0,
line = Cs(V"greentext" + V"pinktext" + V"plainline" + P"") * P"\n" / function(a)
- print("Found line:",a)
if a == "\r" then
return "
"
else
return string.format("
%s
",a) end end, - ending = C(P(1)^0) / function(a) print("failed with ending:", a) return sanitize(a) end, + ending = C(P(1)^0) / function(a) return sanitize(a) end, chunk = V"line"^0 * V"plainline" * V"ending" } ---A chunk of text that the parser chokes on: -local s = [=[ -Minor update to the search function, also added a search bar to the front page. - -Characters in '''bold''' are literal characters, things in ''