Author: Derick Rethans (derickr)
Date: 2024-07-31T17:42:19+01:00
Commit:
https://github.com/php/web-bugs/commit/15a262cd43dc6590fb1c86f1c1e682a3e4779e6b
Raw diff:
https://github.com/php/web-bugs/commit/15a262cd43dc6590fb1c86f1c1e682a3e4779e6b.diff
Fix PHP 8.2/8.3 warnings and deprecations
Changed paths:
M include/functions.php
M src/Database/Statement.php
M www/bug.php
M www/search.php
Diff:
diff --git a/include/functions.php b/include/functions.php
index f03ddb04..381dbc57 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -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] ?? ''));
}
/**
@@ -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);
@@ -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]';
}
diff --git a/src/Database/Statement.php b/src/Database/Statement.php
index f967ef9f..3a99d754 100644
--- a/src/Database/Statement.php
+++ b/src/Database/Statement.php
@@ -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);
diff --git a/www/bug.php b/www/bug.php
index aa90dbed..7e784c33 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -686,7 +686,7 @@
<?php if (!empty($bug['assign'])) { ?>
<td><a href="search.php?cmd=display&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>
@@ -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">
diff --git a/www/search.php b/www/search.php
index 38ad03b7..91b0488a 100644
--- a/www/search.php
+++ b/www/search.php
@@ -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
@@ -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