File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/Illuminate/Database/Query/Grammars Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ protected function compileColumns(Builder $query, $columns)
6060 // If there is a limit on the query, but not an offset, we will add the top
6161 // clause to the query, which serves as a "limit" type clause within the
6262 // SQL Server system similar to the limit keywords available in MySQL.
63- if ($ query ->limit > 0 && $ query ->offset <= 0 ) {
64- $ select .= 'top ' .$ query ->limit .' ' ;
63+ if (is_numeric ( $ query -> limit ) && $ query ->limit > 0 && $ query ->offset <= 0 ) {
64+ $ select .= 'top ' .(( int ) $ query ->limit ) .' ' ;
6565 }
6666
6767 return $ select .$ this ->columnize ($ columns );
@@ -221,10 +221,10 @@ protected function compileTableExpression($sql, $query)
221221 */
222222 protected function compileRowConstraint ($ query )
223223 {
224- $ start = $ query ->offset + 1 ;
224+ $ start = ( int ) $ query ->offset + 1 ;
225225
226226 if ($ query ->limit > 0 ) {
227- $ finish = $ query ->offset + $ query ->limit ;
227+ $ finish = ( int ) $ query ->offset + ( int ) $ query ->limit ;
228228
229229 return "between {$ start } and {$ finish }" ;
230230 }
You can’t perform that action at this time.
0 commit comments