From d05f841bb40148890faf31f50c92cf3180dae09d Mon Sep 17 00:00:00 2001 From: df Date: Thu, 31 Dec 2020 15:18:03 +0000 Subject: [PATCH 1/3] Reduce (or apply) maximum lengths for title and synopsis, allowing for character set prefix byte --- webif/html/browse/assets.jim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webif/html/browse/assets.jim b/webif/html/browse/assets.jim index d08b4f4..8735f9a 100755 --- a/webif/html/browse/assets.jim +++ b/webif/html/browse/assets.jim @@ -103,6 +103,8 @@ if {[llength $plugins(dmenu)]} { } } +# the maxlength values for title and synopsis are 1 less than the maximum to +# allow for an extra byte to indicate character encoding (see rename.jim) puts { @@ -131,7 +133,7 @@ puts { @@ -144,7 +146,7 @@ puts { From 98ef6a876f6f7613b08510147f89eb8420fbc1e8 Mon Sep 17 00:00:00 2001 From: df Date: Thu, 31 Dec 2020 15:22:42 +0000 Subject: [PATCH 2/3] Add missing $ for certain variable references Missing $s invalidated attempts to check the length of title, synopsis, guidance. --- webif/lib/ts.class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webif/lib/ts.class b/webif/lib/ts.class index b998d93..83de168 100644 --- a/webif/lib/ts.class +++ b/webif/lib/ts.class @@ -296,21 +296,21 @@ ts method copy {dst} { } ts method settitle {newtitle} { - if {[string length newtitle] > 48} { return } + if {[string length $newtitle] > 48} { return } exec /mod/bin/hmt "+settitle=${newtitle}" $file set title $newtitle } ts method setsynopsis {newsynopsis} { - if {[string length newsynopsis] > 252} { return } + if {[string length $newsynopsis] > 252} { return } exec /mod/bin/hmt "+setsynopsis=${newsynopsis}" $file set synopsis $newsynopsis } ts method setguidance {newguidance} { - if {[string length newguidance] > 48} { return } + if {[string length $newguidance] > 48} { return } if {$newguidance eq ""} { exec /mod/bin/hmt "-guidance" $file From cf407f9a809a587db068b9ade8b02d8fc7b38379 Mon Sep 17 00:00:00 2001 From: df Date: Mon, 22 Feb 2021 19:31:20 +0000 Subject: [PATCH 3/3] Correct the maximum length enforced for guidance text (74 vs 48) --- webif/lib/ts.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webif/lib/ts.class b/webif/lib/ts.class index 6f516bd..1c5cf12 100644 --- a/webif/lib/ts.class +++ b/webif/lib/ts.class @@ -310,7 +310,7 @@ ts method setsynopsis {newsynopsis} { } ts method setguidance {newguidance} { - if {[string length $newguidance] > 48} { return } + if {[string length $newguidance] > 74} { return } if {$newguidance eq ""} { exec /mod/bin/hmt "-guidance" $file