1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Try to cast to int using a new variable instead of doing it in array

This commit is contained in:
Loic Blot 2016-12-19 10:45:46 +01:00
parent 82d72907da
commit 292bd8b814

View File

@ -151,9 +151,11 @@ class SmsMapper extends Mapper {
public function getMessages ($userId, $start, $limit) {
$messageList = array();
$limit_i = (int) $limit;
$query = \OCP\DB::prepare('SELECT sms_address, sms_date, sms_msg, sms_type, sms_mailbox FROM ' .
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_date > ? ORDER BY sms_date LIMIT ?');
$result = $query->execute(array($userId, $start, (int) $limit));
$result = $query->execute(array($userId, $start, $limit_i));
while ($row = $result->fetchRow()) {
$messageList[$row["sms_date"]] = array(
"address" => $row["sms_address"],