diff options
Diffstat (limited to 'includes/model')
-rw-r--r-- | includes/model/LogEntries_model.php | 3 | ||||
-rw-r--r-- | includes/model/Message_model.php | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/includes/model/LogEntries_model.php b/includes/model/LogEntries_model.php index 8b7f65a0..09bd03dc 100644 --- a/includes/model/LogEntries_model.php +++ b/includes/model/LogEntries_model.php @@ -22,6 +22,9 @@ function LogEntries() { * Returns log entries filtered by a keyword */ function LogEntries_filter($keyword) { + if ($keyword == "") { + return LogEntries(); + } return sql_select("SELECT * FROM `LogEntries` WHERE `nick` LIKE '%" . sql_escape($keyword) . "%' OR `message` LIKE '%" . sql_escape($keyword) . "%' ORDER BY `timestamp` DESC"); } diff --git a/includes/model/Message_model.php b/includes/model/Message_model.php index 0195fbea..652b60ea 100644 --- a/includes/model/Message_model.php +++ b/includes/model/Message_model.php @@ -43,9 +43,9 @@ function Message_send($receiver_user_id, $text) { if (($text != "" && is_numeric($receiver_user_id)) && (sql_num_query("SELECT * FROM `User` WHERE `UID`='" . sql_escape($receiver_user_id) . "' AND NOT `UID`='" . sql_escape($user['UID']) . "' LIMIT 1") > 0)) { sql_query("INSERT INTO `Messages` SET `Datum`='" . sql_escape(time()) . "', `SUID`='" . sql_escape($user['UID']) . "', `RUID`='" . sql_escape($receiver_user_id) . "', `Text`='" . sql_escape($text) . "'"); return true; - } else { - return false; } + + return false; } ?>
\ No newline at end of file |