Skip to content

Commit

Permalink
Fix greedy regex incorrectly splitting query string with multiple FRO…
Browse files Browse the repository at this point in the history
…M statements [Mssql] (#1375)
  • Loading branch information
McManning authored and marcj committed May 28, 2017
1 parent 6aa779e commit 1b5ffef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function applyLimit(&$sql, $offset, $limit)

$selectText = 'SELECT ';

preg_match('/\Aselect(.*)from(.*)/si', $sql, $selectSegment);
preg_match('/\Aselect (.+?) from (.*)/si', $sql, $selectSegment);
if (3 === count($selectSegment)) {
$selectStatement = trim($selectSegment[1]);
$fromStatement = trim($selectSegment[2]);
Expand Down

0 comments on commit 1b5ffef

Please sign in to comment.