Skip to content

Commit f337011

Browse files
committed
cast int for offset and limit
1 parent 9e40cc5 commit f337011

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

laravel/database/query/grammars/sqlserver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ protected function ansi_offset(Query $query, $components)
9191

9292
unset($components['orderings']);
9393

94-
$start = $query->offset + 1;
94+
$start = (int) $query->offset + 1;
9595

9696
// Next we need to calculate the constraint that should be placed on
9797
// the row number to get the correct offset and limit on the query.
9898
// If there is not a limit, we'll just handle the offset.
9999
if ($query->limit > 0)
100100
{
101-
$finish = $query->offset + $query->limit;
101+
$finish = (int) $query->offset + (int) $query->limit;
102102

103103
$constraint = "BETWEEN {$start} AND {$finish}";
104104
}
@@ -137,4 +137,4 @@ protected function offset(Query $query)
137137
return '';
138138
}
139139

140-
}
140+
}

0 commit comments

Comments
 (0)