79557838

Date: 2025-04-06 06:02:17
Score: 0.5
Natty:
Report link

let's look at the problem areas

if (isset($artist['banned']) && $artist['banned'] === 'true') {
    echo '<div class="alert alert-danger text-center">🚫 This artist has been banned. Their profile is restricted.</div>';
    exit;
}

In the above, you are comparing to 'true', which is a string and will not be identical to the boolean true that is contained in the JSON.

In the second case:

           <?php if (!empty($artist['status']) && $artist['suspended'] === 'true'): ?>
                <div class="alert alert-warning mt-2">⚠️ This artist is currently suspended. Their activity may be limited.</div>
            <?php endif; ?>

You not only have the same problem as with banned, but in addition you are checking if something called status is not empty, and not checking if suspended is set. That behavior may or may not be the logic you want.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): have the same problem
  • High reputation (-1):
Posted by: Geoduck