aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-02-03 08:48:57 +0100
committerKarel Kočí <karel.koci@nic.cz>2017-02-03 08:48:57 +0100
commit2739c1427a92f22b2af30f85528a018d3e72ff45 (patch)
tree4324be1cd21db74b7fdc0ce9e12b7ec65187dae9
parenteda6326d35e65098e08518a2c6b499709f8ee67e (diff)
downloadturris-lcd-example-2739c1427a92f22b2af30f85528a018d3e72ff45.tar.gz
turris-lcd-example-2739c1427a92f22b2af30f85528a018d3e72ff45.tar.bz2
turris-lcd-example-2739c1427a92f22b2af30f85528a018d3e72ff45.zip
Limit message size
-rwxr-xr-xweb/add_msg.sh4
-rw-r--r--web/index.html4
2 files changed, 4 insertions, 4 deletions
diff --git a/web/add_msg.sh b/web/add_msg.sh
index a956335..764762f 100755
--- a/web/add_msg.sh
+++ b/web/add_msg.sh
@@ -32,12 +32,12 @@ echo "<!DOCTYPE html>
</head>
<h3>Thank you for your message</h3>
<p>$(cat<<EOFIKA
-$MESSAGE
+${MESSAGE:0:60}
EOFIKA
)
</p>
</html>"
cat >/tmp/turris-lcd <<EOFIKA
-$MESSAGE
+${MESSAGE:0:60}
EOFIKA
diff --git a/web/index.html b/web/index.html
index 1e3de3b..f6f24b0 100644
--- a/web/index.html
+++ b/web/index.html
@@ -5,12 +5,12 @@
</head>
<body>
<form action="./add_msg.sh" method="post">
- <input type="text" name="message"><br>
+ <input type="text" name="message">max. 60 characters<br>
<input type="submit" value="Submit">
</form>
<br>
<sup>
- Only ASCII characters are supported!
+ Only ASCII characters are supported! No special characters.
</sup>
</body>
</html>