diff --git a/includes/security.php b/includes/security.php index 97c51ae..997afc9 100644 --- a/includes/security.php +++ b/includes/security.php @@ -64,7 +64,7 @@ function quicktree_can_edit_tree(int $tree_id): bool { return true; } - $owner = db_fetch_cell_prepared('SELECT user_id FROM graph_tree WHERE id = ?', array($tree_id)); + $owner = db_fetch_cell_prepared('SELECT user_id FROM graph_tree WHERE id = ?', [$tree_id]); return $owner !== false && $owner !== null && (int) $owner === $user_id; } diff --git a/setup.php b/setup.php index 71983f3..a92999e 100644 --- a/setup.php +++ b/setup.php @@ -488,7 +488,7 @@ function quicktree_prune_files(): void { $whitelist = isset($manifest['whitelist']) && is_array($manifest['whitelist']) ? $manifest['whitelist'] : []; $protected = function (string $rel) use ($whitelist): bool { - if (strncmp($rel, '.git', 4) === 0 || strncmp($rel, '.md', 3) === 0) { + if (str_starts_with($rel, '.git') || str_starts_with($rel, '.md')) { return true; }