Skip to content

Commit

Permalink
delete Errrors, change filter type based on column
Browse files Browse the repository at this point in the history
Signed-off-by: albertlast [email protected]
  • Loading branch information
albertlast committed Apr 26, 2020
1 parent a60de0c commit 1042c10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/ManageErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,17 @@ function deleteErrors()
);
// Deleting all with a filter?
elseif (isset($_POST['delall']) && isset($filter))
{
// ip need a different placeholder type
$filter_type = $filter['value']['sql'] == 'ip'? 'inet' : 'string';
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}log_errors
WHERE ' . $filter['variable'] . ' LIKE {string:filter}',
WHERE ' . $filter['variable'] . ' LIKE {' . $filter_type . ':filter}',
array(
'filter' => $filter['value']['sql'],
)
);
}
// Just specific errors?
elseif (!empty($_POST['delete']))
{
Expand Down

0 comments on commit 1042c10

Please sign in to comment.