Skip to content

Commit 662f1bd

Browse files
authored
Support '/' as a possible column name. (#45268)
Escape '/' when checking for guard-able column.
1 parent 3480b7c commit 662f1bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function isGuarded($key)
202202
}
203203

204204
return $this->getGuarded() == ['*'] ||
205-
! empty(preg_grep('/^'.preg_quote($key).'$/i', $this->getGuarded())) ||
205+
! empty(preg_grep('/^'.preg_quote($key, '/').'$/i', $this->getGuarded())) ||
206206
! $this->isGuardableColumn($key);
207207
}
208208

0 commit comments

Comments
 (0)