Skip to content

Commit 0637320

Browse files
committed
Updated
1 parent 14e84a0 commit 0637320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Instrumentation/PDO/src/PDOInstrumentation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ private static function appendSqlComments(string $query, bool $withTraceContext)
388388
$comments[$key] = $value;
389389
}
390390
$query = trim($query);
391-
$hasSemicolon = $query[-1] === ';';
391+
$hasSemicolon = $query !== '' && $query[strlen($query) - 1] === ';';
392392
$query = rtrim($query, ';');
393393

394394
return $query . Utils::formatComments(array_filter($comments)) . ($hasSemicolon ? ';' : '');

0 commit comments

Comments
 (0)