PHP8: Prevent passing of null to strpos

pull/2245/head
phl0 2023-07-07 16:25:22 +02:00
rodzic b6bbae8aab
commit 530029c5bf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -84,7 +84,7 @@
<div>
<div class="form-check-inline">
<?php echo '<input class="form-check-input" type="checkbox" name="qsl" id="qsl"';
if (strpos($user_gridmap_confirmation, 'Q') !== false) {
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) {
echo ' checked' ;
}
echo '>'; ?>
@ -92,7 +92,7 @@
</div>
<div class="form-check-inline">
<?php echo '<input class="form-check-input" type="checkbox" name="lotw" id="lotw"';
if (strpos($user_gridmap_confirmation, 'L') !== false) {
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) {
echo ' checked' ;
}
echo '>'; ?>
@ -100,7 +100,7 @@
</div>
<div class="form-check-inline">
<?php echo '<input class="form-check-input" type="checkbox" name="eqsl" id="eqsl"';
if (strpos($user_gridmap_confirmation, 'E') !== false) {
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
echo ' checked' ;
}
echo '>'; ?>

Wyświetl plik

@ -553,7 +553,7 @@
<label class="my-1 mr-2"><?php echo lang('gridsquares_confirmation'); ?></label>
<div class="form-check-inline">
<?php echo '<input class="form-check-input" type="checkbox" name="user_gridmap_confirmation_qsl" id="user_gridmap_confirmation_qsl"';
if (strpos($user_gridmap_confirmation, 'Q') !== false) {
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) {
echo ' checked';
}
echo '>'; ?>
@ -561,7 +561,7 @@
</div>
<div class="form-check-inline">
<?php echo '<input class="form-check-input" type="checkbox" name="user_gridmap_confirmation_lotw" id="user_gridmap_confirmation_lotw"';
if (strpos($user_gridmap_confirmation, 'L') !== false) {
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) {
echo ' checked';
}
echo '>'; ?>
@ -569,7 +569,7 @@
</div>
<div class="form-check-inline">
<?php echo '<input class="form-check-input" type="checkbox" name="user_gridmap_confirmation_eqsl" id="user_gridmap_confirmation_eqsl"';
if (strpos($user_gridmap_confirmation, 'E') !== false) {
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
echo ' checked';
}
echo '>'; ?>