From 4ed69f3394a336c2fe6c8fa81741e55036bd70b7 Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 26 Feb 2011 14:20:00 -0500 Subject: Do a more strict check on the return value of the download function. Fixes #1309 --- usr/local/www/system_firmware_check.php | 2 +- usr/local/www/widgets/widgets/system_information.widget.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php index 266a149..25d3095 100755 --- a/usr/local/www/system_firmware_check.php +++ b/usr/local/www/system_firmware_check.php @@ -131,7 +131,7 @@ if ($g['platform'] == "nanobsd") { $nanosize .= strtolower(trim(file_get_contents("/etc/nanosize.txt"))); } -if(download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version", 'read_body', 5, 5)) +if(download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version", 'read_body', 5, 5) === true) $remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version")); $static_text .= gettext("done") . "\\n"; if (!$remote_version) { diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 3de2ab1..e1e4645 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -49,7 +49,7 @@ if($_REQUEST['getupdatestatus']) { } @unlink("/tmp/{$g['product_name']}_version"); - if (download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version", 'read_body', 5, 5)) + if (download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version", 'read_body', 5, 5) === true) $remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version")); if(empty($remote_version)) -- cgit v1.1