comparison mod_pastebin/mod_pastebin.lua @ 934:15e2c4fd26a0

mod_pastebin: Fix invalid debug statement
author Kim Alvefur <zash@zash.se>
date Mon, 25 Mar 2013 00:40:17 +0100
parents 6c2b77f97e62
children 28e3257d2ae5
comparison
equal deleted inserted replaced
933:5a975ba6a845 934:15e2c4fd26a0
7 local add_task = require "util.timer".add_task; 7 local add_task = require "util.timer".add_task;
8 8
9 local utf8_pattern = "[\194-\244][\128-\191]*$"; 9 local utf8_pattern = "[\194-\244][\128-\191]*$";
10 local function drop_invalid_utf8(seq) 10 local function drop_invalid_utf8(seq)
11 local start = seq:byte(); 11 local start = seq:byte();
12 module:log("utf8: %d, %d", start, #seq); 12 module:log("debug", "utf8: %d, %d", start, #seq);
13 if (start <= 223 and #seq < 2) 13 if (start <= 223 and #seq < 2)
14 or (start >= 224 and start <= 239 and #seq < 3) 14 or (start >= 224 and start <= 239 and #seq < 3)
15 or (start >= 240 and start <= 244 and #seq < 4) 15 or (start >= 240 and start <= 244 and #seq < 4)
16 or (start > 244) then 16 or (start > 244) then
17 return ""; 17 return "";