mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 02:53:37 +08:00
remove use of like which might cause unwanted side effects (#1787)
This commit is contained in:
parent
c740c7f593
commit
57463f4862
|
@ -45,8 +45,8 @@ class DatabaseSettingsRepository implements SettingsRepositoryInterface
|
|||
$query->$method(compact('key', 'value'));
|
||||
}
|
||||
|
||||
public function delete($keyLike)
|
||||
public function delete($key)
|
||||
{
|
||||
$this->database->table('settings')->where('key', 'like', $keyLike)->delete();
|
||||
$this->database->table('settings')->where('key', $key)->delete();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ class UserRepository
|
|||
*/
|
||||
public function getIdForUsername($username, User $actor = null)
|
||||
{
|
||||
$query = User::where('username', 'like', $username);
|
||||
$query = User::where('username', $username);
|
||||
|
||||
return $this->scopeVisibleTo($query, $actor)->value('id');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user