Skip to content

Commit dd61dff

Browse files
committed
Fix null grid square handling for PHP 8 compatibility
Normalizes COL_GRIDSQUARE and COL_VUCC_GRIDS to empty strings if null to prevent strlen warnings under PHP 8. Ensures correct display of grid information in search results.
1 parent 1000faf commit dd61dff

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

application/views/search/search_result_ajax.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ function echo_table_col($row, $name)
104104
echo ($row->COL_STATE);
105105
break;
106106
case 'Grid':
107-
echo strlen($row->COL_GRIDSQUARE) == 0 ? $row->COL_VUCC_GRIDS : $row->COL_GRIDSQUARE;
107+
// Avoid strlen warnings on null under PHP 8 by normalizing first
108+
$grid = $row->COL_GRIDSQUARE ?? '';
109+
$vucc = $row->COL_VUCC_GRIDS ?? '';
110+
echo ($grid === '' ? $vucc : $grid);
108111
break;
109112
case 'Distance':
110113
echo ($row->COL_DISTANCE ? $row->COL_DISTANCE . ' km' : '');

0 commit comments

Comments
 (0)