Fixes for tag / source history

This commit is contained in:
Shish
2019-06-09 08:32:01 +01:00
parent fad31ed38d
commit e77f7de7f9
4 changed files with 16 additions and 20 deletions

View File

@@ -250,7 +250,7 @@ class Source_History extends Extension
/**
* This function attempts to revert all changes by a given IP within an (optional) timeframe.
*/
public function process_revert_all_changes(string $name, string $ip, string $date)
public function process_revert_all_changes(?string $name, ?string $ip, ?string $date)
{
global $database;
@@ -268,16 +268,16 @@ class Source_History extends Extension
}
}
if (!is_null($date)) {
$select_code[] = 'date_set >= ?';
$select_args[] = $date;
}
if (!is_null($ip)) {
$select_code[] = 'user_ip = ?';
$select_args[] = $ip;
}
if (!is_null($date)) {
$select_code[] = 'date_set >= ?';
$select_args[] = $date;
}
if (count($select_code) == 0) {
log_error("source_history", "Tried to mass revert without any conditions");
return;