From 4fa1b0139a63c1a7747f3456f69cc740e1c23232 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 10 Sep 2009 18:24:57 -0400 Subject: Use ['name'] instead of ['tmp_name'] --- usr/local/www/system_firmware.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index 522893f..d5d696b 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -49,10 +49,10 @@ require_once("xmlrpc_client.inc"); ini_set('max_execution_time', '3600'); ini_set('max_input_time', '3600'); -function file_is_for_platform($filename) { +function file_is_for_platform($filename, $ul_name) { global $g; if($g['platform'] == "nanobsd") { - if(stristr($filename, "nanobsd")) + if(stristr($ul_name, "nanobsd")) return true; else return false; @@ -114,7 +114,7 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { } else if ($mode == "upgrade") { if (is_uploaded_file($_FILES['ulfile']['tmp_name'])) { /* verify firmware image(s) */ - if (file_is_for_platform($_FILES['ulfile']['tmp_name']) == false && !$_POST['sig_override']) + if (file_is_for_platform($_FILES['ulfile']['tmp_name'], $_FILES['ulfile']['name']) == false && !$_POST['sig_override']) $input_errors[] = "The uploaded image file is not for this platform ({$g['platform']})."; else if (!file_exists($_FILES['ulfile']['tmp_name'])) { /* probably out of memory for the MFS */ -- cgit v1.1