fix: invalid use of isset

This commit is contained in:
grandeljay 2023-08-30 15:15:46 +02:00
parent 0f16293f4e
commit 1d50f3febc
3 changed files with 4 additions and 6 deletions

View file

@ -14,7 +14,7 @@ $user = User::getCurrent();
switch ($_SERVER['REQUEST_METHOD']) {
case 'POST':
if (isset($_POST['wishlist-name'], $user->getId())) {
if (isset($_POST['wishlist-name'])) {
/**
* Create
*/
@ -155,7 +155,7 @@ switch ($_SERVER['REQUEST_METHOD']) {
} else {
http_response_code(404);
}
} elseif (isset($_GET['userid']) || isset($user->getId())) {
} elseif (isset($_GET['userid'])) {
/**
* Get user wishlists
*/

View file

@ -197,7 +197,7 @@ class Wish
$userCard->getLocale() . '@currency=' . $userCard->getCurrency(),
\NumberFormatter::CURRENCY
);
$userIsCurrent = isset($userCurrent->getId()) && $userCurrent->getId() === $userCard->getId();
$userIsCurrent = $userCurrent->getId() === $userCard->getId();
/**
* Card

View file

@ -52,7 +52,6 @@ if (isset($_POST['reset'], $_POST['email'])) {
$user = false !== $userQuery ? new User($userQuery->fetch()) : new User();
if (isset($user->getId())) {
$token = sha1(time() . rand(0, 999999));
$validUntil = time() + 3600;
@ -93,7 +92,6 @@ if (isset($_POST['reset'], $_POST['email'])) {
__('If a match can be found for this email address, a password reset link will be sent to it.'),
__('Info')
);
}
}
$page->header();