Skip to content

Commit 2c1aae2

Browse files
Merge pull request #6 from whitecube/voidgraphics-patch-1
Fix SQL injection in whereRaw
2 parents 3dc81d8 + cfa78a3 commit 2c1aae2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/HasSlug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function resolveRouteBinding($value, $field = null)
256256

257257
// Get the models where this slug exists in other langs as well
258258
$results = $this->getRouteBindingQueryBuilder()
259-
->whereRaw('JSON_SEARCH(`'.$key.'`, "one", "'.$value.'")')
259+
->whereRaw('JSON_SEARCH(`?`, "one", "?")', [$key, $value])
260260
->get();
261261

262262
// If we have zero or multiple results, don't guess

0 commit comments

Comments
 (0)