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

View file

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

View file

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