Skip to content

Commit 4792d12

Browse files
committed
Fix PHP 8.2/8.3 warnings and deprecations
1 parent 2d6fbb5 commit 4792d12

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

include/functions.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function field($n)
334334
{
335335
return oneof(isset($_POST['in']) ?
336336
htmlspecialchars(isset($_POST['in'][$n]) ? $_POST['in'][$n] : '') : null,
337-
htmlspecialchars($GLOBALS['bug'][$n]));
337+
htmlspecialchars($GLOBALS['bug'][$n] ?? ''));
338338
}
339339

340340
/**
@@ -656,7 +656,7 @@ function ($value) {
656656

657657

658658
foreach ($bug_groups as $key => $bug_group) {
659-
echo "<optgroup label=\"${bug_group[0]}\"" .
659+
echo "<optgroup label=\"{$bug_group[0]}\"" .
660660
(($bug_group[1]) ? $disabled_style : ''), "\n>";
661661

662662
array_unshift($bug_group[2], $key);
@@ -1240,7 +1240,7 @@ function get_package_mail($package_name, $bug_id = false, $bug_type = 'Bug')
12401240
// Security problems *always* go to the sec team
12411241
$to[] = $secBugEmail;
12421242
foreach ($security_distro_people as $user) {
1243-
$to[] = "${user}@php.net";
1243+
$to[] = "{$user}@php.net";
12441244
}
12451245
$params = '-f [email protected]';
12461246
}

src/Database/Statement.php

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Statement extends \PDOStatement
1313
* \PDOStatement::execute(), on the other hand, returns boolean. Change it
1414
* to return $this and thus allow further method chaining.
1515
*/
16+
#[\ReturnTypeWillChange]
1617
public function execute($parameters = null): self
1718
{
1819
parent::execute($parameters);

www/bug.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@
686686
<?php if (!empty($bug['assign'])) { ?>
687687
<td><a href="search.php?cmd=display&amp;assign=<?php echo urlencode($bug['assign']), '">', htmlspecialchars($bug['assign']); ?></a> (<a href="https://people.php.net/<?php echo urlencode($bug['assign']); ?>">profile</a>)</td>
688688
<?php } else { ?>
689-
<td><?php echo htmlspecialchars($bug['assign']); ?></td>
689+
<td><?php echo htmlspecialchars($bug['assign'] ?? ''); ?></td>
690690
<?php } ?>
691691
</tr>
692692

@@ -701,7 +701,7 @@
701701
<th class="details">PHP Version:</th>
702702
<td><?php echo htmlspecialchars($bug['php_version']); ?></td>
703703
<th class="details">OS:</th>
704-
<td><?php echo htmlspecialchars($bug['php_os']); ?></td>
704+
<td><?php echo htmlspecialchars($bug['php_os'] ?? ''); ?></td>
705705
</tr>
706706

707707
<tr id="private">

www/search.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Redirect early if a bug id is passed as search string
1212
if (isset($_GET['search_for']) && preg_match('/^\d+$/', trim($_GET['search_for']), $search_for_id_array)) {
13-
redirect("bug.php?id=${search_for_id_array[0]}");
13+
redirect("bug.php?id={$search_for_id_array[0]}");
1414
}
1515

1616
// For bug count only, used in places like doc.php.net
@@ -162,7 +162,7 @@
162162
echo ' <td align="center">', format_date(strtotime($row['ts1'])), "</td>\n";
163163

164164
// Last Modified
165-
$ts2 = strtotime($row['ts2']);
165+
$ts2 = strtotime($row['ts2'] ?? date('Y-m-d H:i:s'));
166166
echo ' <td align="center">' , ($ts2 ? format_date($ts2) : 'Not modified') , "</td>\n";
167167

168168
// Package

0 commit comments

Comments
 (0)