Skip to content

Commit

Permalink
Fix PHP 8.2/8.3 warnings and deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Aug 1, 2024
1 parent 2d6fbb5 commit 4792d12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function field($n)
{
return oneof(isset($_POST['in']) ?
htmlspecialchars(isset($_POST['in'][$n]) ? $_POST['in'][$n] : '') : null,
htmlspecialchars($GLOBALS['bug'][$n]));
htmlspecialchars($GLOBALS['bug'][$n] ?? ''));
}

/**
Expand Down Expand Up @@ -656,7 +656,7 @@ function ($value) {


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

array_unshift($bug_group[2], $key);
Expand Down Expand Up @@ -1240,7 +1240,7 @@ function get_package_mail($package_name, $bug_id = false, $bug_type = 'Bug')
// Security problems *always* go to the sec team
$to[] = $secBugEmail;
foreach ($security_distro_people as $user) {
$to[] = "${user}@php.net";
$to[] = "{$user}@php.net";
}
$params = '-f [email protected]';
}
Expand Down
1 change: 1 addition & 0 deletions src/Database/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Statement extends \PDOStatement
* \PDOStatement::execute(), on the other hand, returns boolean. Change it
* to return $this and thus allow further method chaining.
*/
#[\ReturnTypeWillChange]
public function execute($parameters = null): self
{
parent::execute($parameters);
Expand Down
4 changes: 2 additions & 2 deletions www/bug.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
<?php if (!empty($bug['assign'])) { ?>
<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>
<?php } else { ?>
<td><?php echo htmlspecialchars($bug['assign']); ?></td>
<td><?php echo htmlspecialchars($bug['assign'] ?? ''); ?></td>
<?php } ?>
</tr>

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

<tr id="private">
Expand Down
4 changes: 2 additions & 2 deletions www/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

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

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

// Package
Expand Down

0 comments on commit 4792d12

Please sign in to comment.