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 @@ -61,8 +61,8 @@ protected function compileColumns(Builder $query, $columns)
6161 // If there is a limit on the query, but not an offset, we will add the top
6262 // clause to the query, which serves as a "limit" type clause within the
6363 // SQL Server system similar to the limit keywords available in MySQL.
64- if ($ query ->limit > 0 && $ query ->offset <= 0 ) {
65- $ select .= 'top ' .$ query ->limit .' ' ;
64+ if (is_numeric ( $ query -> limit ) && $ query ->limit > 0 && $ query ->offset <= 0 ) {
65+ $ select .= 'top ' .(( int ) $ query ->limit ) .' ' ;
6666 }
6767
6868 return $ select .$ this ->columnize ($ columns );
@@ -222,10 +222,10 @@ protected function compileTableExpression($sql, $query)
222222 */
223223 protected function compileRowConstraint ($ query )
224224 {
225- $ start = $ query ->offset + 1 ;
225+ $ start = ( int ) $ query ->offset + 1 ;
226226
227227 if ($ query ->limit > 0 ) {
228- $ finish = $ query ->offset + $ query ->limit ;
228+ $ finish = ( int ) $ query ->offset + ( int ) $ query ->limit ;
229229
230230 return "between {$ start } and {$ finish }" ;
231231 }
You can’t perform that action at this time.
0 commit comments