mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
If some domains are not added, then this happened because they are duplicates. Highlight this in the success message.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -135,11 +135,23 @@ function add_to_table($db, $table, $domains, $wildcardstyle=false, $returnnum=fa
|
||||
{
|
||||
$finalcount = intval($db->querySingle("SELECT COUNT(*) FROM ".$table.";"));
|
||||
$modified = $finalcount - $initialcount;
|
||||
|
||||
// If we add less domains than the user specified, then they wanted to add duplicates
|
||||
if($modified !== $num)
|
||||
{
|
||||
$delta = $num - $modified;
|
||||
$extra = " (".$delta." already existing)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$extra = "";
|
||||
}
|
||||
|
||||
if($num === 1)
|
||||
$plural = "";
|
||||
else
|
||||
$plural = "s";
|
||||
return "Success, added ".$modified." of ".$num." domain".$plural;
|
||||
return "Success, added ".$modified." of ".$num." domain".$plural.$extra;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user