From 23899139e50e4928cf55d84eeff631b41c6d48c8 Mon Sep 17 00:00:00 2001 From: Imran Hussain Date: Thu, 24 Jan 2019 12:02:12 +0000 Subject: [PATCH 1/2] Cut a bit too much from motd.php :) --- components/motd.php | 1 + 1 file changed, 1 insertion(+) diff --git a/components/motd.php b/components/motd.php index 2c3eb66..00d960b 100644 --- a/components/motd.php +++ b/components/motd.php @@ -4,6 +4,7 @@ $motd_file = "/etc/motd"; function decode_entities($text, $quote_style = ENT_COMPAT) { $text = html_entity_decode($text, $quote_style, 'ISO-8859-1'); // NOTE: UTF-8 does not work! + $text = preg_replace('~&ndash\;~i', '-', $text); $text = preg_replace_callback('~&#x([0-9a-f]+);~i', function ($matches) { foreach ($matches as $match) { -- GitLab From 83f21ec5225627b5ba5f1d6ed03e2aef444ab8cc Mon Sep 17 00:00:00 2001 From: Imran Hussain Date: Wed, 6 Feb 2019 14:25:31 +0000 Subject: [PATCH 2/2] [1/?] Allow student IDs > 6 digits --- lib/validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validation.php b/lib/validation.php index c39b3fa..0c152c9 100644 --- a/lib/validation.php +++ b/lib/validation.php @@ -125,7 +125,7 @@ function validSID($SID, $override) return true; } } else { - if (!preg_match("/^[0-9]*$/", $SID) || strlen($SID) != 6) { + if (!preg_match("/^[0-9]{6,}$/", $SID)) { $error = "Invalid student ID"; return false; } elseif (sidUsed($SID)) { -- GitLab