diff --git a/laravel/database/query/grammars/grammar.php b/laravel/database/query/grammars/grammar.php index d5d8a2e7d..3f2f78b77 100755 --- a/laravel/database/query/grammars/grammar.php +++ b/laravel/database/query/grammars/grammar.php @@ -355,7 +355,7 @@ class Grammar extends \Laravel\Database\Grammar { */ protected function limit(Query $query) { - return 'LIMIT '.$query->limit; + return 'LIMIT '. (int) $query->limit; } /** @@ -366,7 +366,7 @@ class Grammar extends \Laravel\Database\Grammar { */ protected function offset(Query $query) { - return 'OFFSET '.$query->offset; + return 'OFFSET '. (int) $query->offset; } /** @@ -488,4 +488,4 @@ class Grammar extends \Laravel\Database\Grammar { return trim($sql); } -} \ No newline at end of file +} diff --git a/laravel/database/query/grammars/sqlserver.php b/laravel/database/query/grammars/sqlserver.php index f912f562f..4af8a0d4f 100644 --- a/laravel/database/query/grammars/sqlserver.php +++ b/laravel/database/query/grammars/sqlserver.php @@ -59,7 +59,7 @@ class SQLServer extends Grammar { // it to the query here if there is not an OFFSET present. if ($query->limit > 0 and $query->offset <= 0) { - $select .= 'TOP '.$query->limit.' '; + $select .= 'TOP '. (int) $query->limit.' '; } return $select.$this->columnize($query->selects); @@ -91,14 +91,14 @@ class SQLServer extends Grammar { unset($components['orderings']); - $start = $query->offset + 1; + $start = (int) $query->offset + 1; // Next we need to calculate the constraint that should be placed on // the row number to get the correct offset and limit on the query. // If there is not a limit, we'll just handle the offset. if ($query->limit > 0) { - $finish = $query->offset + $query->limit; + $finish = (int) $query->offset + (int) $query->limit; $constraint = "BETWEEN {$start} AND {$finish}"; } @@ -137,4 +137,4 @@ class SQLServer extends Grammar { return ''; } -} \ No newline at end of file +}