Skip to content

Commit

Permalink
#1203 Fix empty censorings
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick committed Apr 6, 2015
1 parent 896af6f commit f6dc04d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backstage/censoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@

if (!$luna_user['is_admmod'])
header("Location: login.php");

// Add a censor word
if (isset($_POST['add_word'])) {
confirm_referrer('backstage/censoring.php');

$search_for = luna_trim($_POST['new_search_for']);
$replace_with = luna_trim($_POST['new_replace_with']);

if ($search_for == '')
if ($search_for == '') {
message_backstage($lang['Must enter word message']);
exit;
}

$db->query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Unable to add censor word', __FILE__, __LINE__, $db->error());

Expand Down

0 comments on commit f6dc04d

Please sign in to comment.