summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--application/libraries/Duser/drivers/Duser_db.php12
-rw-r--r--application/libraries/Pygments.php18
3 files changed, 33 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index acd9ae7fa..a81e29cb7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
This file lists major, incompatible or otherwise important changes, you should look at it after every update.
NEXT
+
+4.0.2 2024-04-14
+ - Fix syntax highlighting for systemd files
+ - Fix password reset trying to send mails to deleted users
+
+4.0.1 2024-01-14
- Fix PHP 8.2 deprecation warnings
- Fix PHP 8.3 deprecation warnings
- Update CodeIgniter to development branch
diff --git a/application/libraries/Duser/drivers/Duser_db.php b/application/libraries/Duser/drivers/Duser_db.php
index 062da9e54..e1df20f1f 100644
--- a/application/libraries/Duser/drivers/Duser_db.php
+++ b/application/libraries/Duser/drivers/Duser_db.php
@@ -24,6 +24,10 @@ class Duser_db extends Duser_Driver {
{
$CI =& get_instance();
+ if ($username === null) {
+ return false;
+ }
+
$query = $CI->db->select('username, id, password')
->from('users')
->where('username', $username)
@@ -48,6 +52,10 @@ class Duser_db extends Duser_Driver {
{
$CI =& get_instance();
+ if ($username === null) {
+ return false;
+ }
+
$query = $CI->db->select('id')
->from('users')
->where('username', $username)
@@ -64,6 +72,10 @@ class Duser_db extends Duser_Driver {
{
$CI =& get_instance();
+ if ($userid === null) {
+ throw new \exceptions\ApiException("libraries/duser/db/get_email-failed", "User does not exist");
+ }
+
$query = $CI->db->select('email')
->from('users')
->where('id', $userid)
diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php
index 6f51cc9e7..9386da418 100644
--- a/application/libraries/Pygments.php
+++ b/application/libraries/Pygments.php
@@ -115,6 +115,7 @@ class Pygments {
'application/x-shellscript' => 'bash',
'application/xslt+xml' => "xml",
'application/x-x509-ca-cert' => 'text',
+ 'application/x-wine-extension-ini' => 'ini',
'message/rfc822' => 'text',
'text/css' => 'css',
'text/html' => 'xml',
@@ -190,16 +191,18 @@ class Pygments {
}
$extensionarray = array(
+ 'automount' => 'systemd',
'awk' => 'awk',
- 'cast' => 'asciinema',
'c' => 'c',
+ 'cast' => 'asciinema',
'coffee' => 'coffee-script',
'cpp' => 'cpp',
'cr' => 'crystal',
+ 'device' => 'systemd',
'diff' => 'diff',
'go' => 'go',
- 'haml' => 'haml',
'h' => 'c',
+ 'haml' => 'haml',
'hs' => 'haskell',
'html' => 'xml',
'java' => 'java',
@@ -207,12 +210,14 @@ class Pygments {
'json' => 'json',
'lhs' => 'lhs',
'lua' => 'lua',
+ 'ml' => 'ocaml',
'mli' => 'ocaml',
'mll' => 'ocaml',
- 'ml' => 'ocaml',
'mly' => 'ocaml',
+ 'mount' => 'systemd',
'mysql' => 'mysql',
'patch' => 'diff',
+ 'path' => 'systemd',
'pgsql' => 'postgresql',
'php' => 'php',
'pl' => 'perl',
@@ -224,10 +229,17 @@ class Pygments {
'rb' => 'ruby',
'rs' => 'rust',
's' => 'asm',
+ 'scope' => 'systemd',
+ 'service' => 'systemd',
'sh' => 'bash',
+ 'slice' => 'systemd',
+ 'socket' => 'systemd',
'sql' => 'sql',
+ 'swap' => 'systemd',
+ 'target' => 'systemd',
'tcl' => 'tcl',
'tex' => 'tex',
+ 'timer' => 'systemd',
'yml' => 'yaml',
);
if (array_key_exists($extension, $extensionarray)) return $extensionarray[$extension];