Skip to content

Commit

Permalink
fixed error with % char in unnamed mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
TinderBox authored Oct 27, 2017
1 parent 2a6f0a5 commit 355d144
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Query/Mapper/UnnamedMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ public function bind(string $query, array $bindings): string
$escapedBindings = $this->escapeBindings($bindings);

$query = str_replace('?', '%s', $query);

return call_user_func_array('sprintf', array_merge([$query], $escapedBindings));
$query = str_replace('%', '%%', $query);
$query = call_user_func_array('sprintf', array_merge([$query], $escapedBindings));

return $query;
}

protected function getBindingPattern(): string
Expand Down

0 comments on commit 355d144

Please sign in to comment.