From 4b8b2e3eb139518ea1abd5875135bb39a9f0c187 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 12 May 2018 13:35:11 +0200 Subject: Stop using each() The each() function has been deprecated as of PHP 7.2.0. Use foreach loops instead. Signed-off-by: Lukas Fleischer --- web/html/rss.php | 2 +- web/html/voters.php | 4 ++-- web/template/account_edit_form.php | 4 ++-- web/template/account_search_results.php | 12 ++++++------ web/template/pkg_comments.php | 4 ++-- web/template/pkg_details.php | 12 ++++++------ web/template/pkg_search_results.php | 4 ++-- web/template/pkgbase_details.php | 4 ++-- web/template/pkgreq_results.php | 4 ++-- web/template/tu_last_votes_list.php | 4 ++-- web/template/tu_list.php | 4 ++-- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/web/html/rss.php b/web/html/rss.php index 8585d81d..d6e7825a 100644 --- a/web/html/rss.php +++ b/web/html/rss.php @@ -40,7 +40,7 @@ $rss->image = $image; #Get the latest packages and add items for them $packages = latest_pkgs(20); -while (list($indx, $row) = each($packages)) { +foreach ($packages as $indx => $row) { $item = new FeedItem(); $item->title = $row["Name"]; $item->link = "{$protocol}://{$host}" . get_pkg_uri($row["Name"]); diff --git a/web/html/voters.php b/web/html/voters.php index 997186d8..bacbcfc8 100644 --- a/web/html/voters.php +++ b/web/html/voters.php @@ -16,14 +16,14 @@ if (has_credential(CRED_PKGBASE_LIST_VOTERS)):

Votes for

    - + $row): ?>
  • 0): ?> ()
  • - +
diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php index 833e74a8..6eff81bd 100644 --- a/web/template/account_edit_form.php +++ b/web/template/account_edit_form.php @@ -122,7 +122,7 @@ $val) { if ($TZ == $key) { print "\n"; } else { diff --git a/web/template/account_search_results.php b/web/template/account_search_results.php index 43f2d1d6..81cd8185 100644 --- a/web/template/account_search_results.php +++ b/web/template/account_search_results.php @@ -18,7 +18,7 @@ else: $row): if ($i % 2): $c = "even"; else: @@ -51,7 +51,7 @@ else: @@ -64,10 +64,10 @@ else: $ind): ?> - + " /> @@ -79,10 +79,10 @@ else: $ind): ?> - + -->" /> diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index 7d9bedcc..3e5e5cc5 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -15,7 +15,7 @@ if (!isset($count)) { - + $row): ?> - + 10 && !isset($_GET['comments']) && !isset($pinned)): ?>

diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 8a934173..650c245c 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -276,9 +276,9 @@ endif;

0): ?> @@ -286,9 +286,9 @@ endif;

0): ?> @@ -298,9 +298,9 @@ endif; 0): ?>
    - + $src): ?>
  • - +
diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index d7512b1e..7c5ad03b 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -66,7 +66,7 @@ if (!$result): ?> - + $row): ?> ]" value="1" /> @@ -100,7 +100,7 @@ if (!$result): ?> - + diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index de55da03..8a6e2b44 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -126,10 +126,10 @@ endif; 0): ?> diff --git a/web/template/pkgreq_results.php b/web/template/pkgreq_results.php index e02cff3e..1a565c3e 100644 --- a/web/template/pkgreq_results.php +++ b/web/template/pkgreq_results.php @@ -36,7 +36,7 @@ - + $row): ?> $idle_time); @@ -100,7 +100,7 @@ - + diff --git a/web/template/tu_last_votes_list.php b/web/template/tu_last_votes_list.php index 5cff248c..6e852581 100644 --- a/web/template/tu_last_votes_list.php +++ b/web/template/tu_last_votes_list.php @@ -11,7 +11,7 @@ - $row): if ($indx % 2): $c = "even"; else: @@ -28,7 +28,7 @@ diff --git a/web/template/tu_list.php b/web/template/tu_list.php index b7253f98..204c89ea 100644 --- a/web/template/tu_list.php +++ b/web/template/tu_list.php @@ -26,7 +26,7 @@ - + $row): ?> - + -- cgit v1.2.3-24-g4f1b