Avoid shadowing global variable

When we aren't referencing the current `global $user`, we should give it
a different name to avoid confusion
This commit is contained in:
Shish
2019-11-11 16:24:13 +00:00
parent bde49c4f5e
commit 247cfcbd77
8 changed files with 31 additions and 31 deletions

View File

@@ -194,9 +194,9 @@ class Notes extends Extension
$notes = $matches[2];
$event->add_querylet(new Querylet("images.id IN (SELECT id FROM images WHERE notes $cmp $notes)"));
} elseif (preg_match("/^notes_by[=|:](.*)$/i", $event->term, $matches)) {
$user = User::by_name($matches[1]);
if (!is_null($user)) {
$user_id = $user->id;
$my_user = User::by_name($matches[1]);
if (!is_null($my_user)) {
$user_id = $my_user->id;
} else {
$user_id = -1;
}