[web-php] master: Fix: Remove parameter where argument is never specified
| From: | Andreas Möller via GitHub | Date: | Tue, 28 Jun 2022 12:46:30 +0000 |
| Subject: | [web-php] master: Fix: Remove parameter where argument is never specified | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-30162@lists.php.net to get a copy of this message | ||
Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: cmb69
Date: 2022-06-28T14:40:31+02:00
Commit: https://github.com/php/web-php/commit/5e659e0dc411faa23deaac43e58cab317257f60c
Raw diff: https://github.com/php/web-php/commit/5e659e0dc411faa23deaac43e58cab317257f60c.diff
Fix: Remove parameter where argument is never specified
Closes GH-573.
Changed paths:
M include/layout.inc
Diff:
diff --git a/include/layout.inc b/include/layout.inc
index 8ef24b111..7aafdc713 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -192,44 +192,39 @@ function print_popup_link($url, $linktext=false, $windowprops="",
$target=false,
}
// Print a link for a downloadable file (including filesize)
-function download_link($file, $title, $showsize = TRUE)
+function download_link($file, $title)
{
$download_link = "/distributions/" . $file;
// Print out the download link
print_link($download_link, $title);
- // Size display is required
- if ($showsize) {
+ // We have a full path or a relative to the distributions dir
+ if ($tmp = strrchr($file, "/")) {
+ $local_file = substr($tmp, 1, strlen($tmp));
+ } else {
+ $local_file = "distributions/$file";
+ }
- // We have a full path or a relative to the distributions dir
- if ($tmp = strrchr($file, "/")) {
- $local_file = substr($tmp, 1, strlen($tmp));
- } else {
- $local_file = "distributions/$file";
- }
+ if(@file_exists($local_file.".asc")) {
+ echo " ";
+ $sig_link = "/distributions/$file.asc";
+ print_link($sig_link, "(sig)");
+ }
- if(@file_exists($local_file.".asc")) {
- echo " ";
- $sig_link = "/distributions/$file.asc";
- print_link($sig_link, "(sig)");
- }
+ // Try to get the size of the file
+ $size = @filesize($local_file);
- // Try to get the size of the file
- $size = @filesize($local_file);
-
- // Print out size in bytes (if size is
- // less then 1Kb, or else in Kb)
- if ($size) {
- echo ' [';
- if ($size < 1024) {
- echo number_format($size, 0, '.', ',') . 'b';
- } else {
- echo number_format($size/1024, 0, '.', ',') . 'Kb';
- }
- echo ']';
+ // Print out size in bytes (if size is
+ // less then 1Kb, or else in Kb)
+ if ($size) {
+ echo ' [';
+ if ($size < 1024) {
+ echo number_format($size, 0, '.', ',') . 'b';
+ } else {
+ echo number_format($size/1024, 0, '.', ',') . 'Kb';
}
-
+ echo ']';
}
}