diff --git a/components/motd.php b/components/motd.php index 2c3eb66755f63d5624f4c710da226dfe304c5a05..00d960bbd5de5509f948dffa23a7db4275dea4d6 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) { diff --git a/lib/validation.php b/lib/validation.php index c39b3fad58e6f0b3ae1edf64e7f4b15fd3429e04..0c152c950f5e2cb7ab968a9271707a34fa0ea93d 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)) {