From 4fe33a0b7a37e138c4342295fd5266e52821d604 Mon Sep 17 00:00:00 2001 From: Churro Date: Tue, 2 Dec 2014 22:29:54 +0100 Subject: [PATCH] Fix for duplicate htpasswd entries (Nginx) --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 0c06ab1f..c27668aa 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -1013,6 +1013,8 @@ class nginx { foreach ($this->htpasswds_data as $htpasswd_filename => $htpasswd_file) { $this->known_htpasswdsfilenames[] = basename($htpasswd_filename); $htpasswd_file_handler = fopen($htpasswd_filename, 'w'); + // Filter duplicate pairs of username and password + $htpasswd_file = implode("\n", array_unique(explode("\n", $htpasswd_file))); fwrite($htpasswd_file_handler, $htpasswd_file); fclose($htpasswd_file_handler); }