From 26f8c80a21aa959fd6731b6c8582d19e13b9d723 Mon Sep 17 00:00:00 2001 From: Arno Renevier Date: Sun, 4 Dec 2011 12:26:01 +0100 Subject: [PATCH 1/1] fixes notices --- inc/html/admin.php | 6 ++++-- inc/html/install.php | 2 +- inc/langutils.php | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/inc/html/admin.php b/inc/html/admin.php index ef43708..d15846a 100644 --- a/inc/html/admin.php +++ b/inc/html/admin.php @@ -39,8 +39,10 @@ if (!$usrtblexists || !$itemstblexists) { exit (); } // if ($error) - $user = $_COOKIE [sprintf ("%suser", DBPREFIX)]; - $pwd = $_COOKIE [sprintf ("%sauth", DBPREFIX)]; + $userkey = sprintf ("%suser", DBPREFIX); + $user = (isset($_COOKIE [$userkey]))? $_COOKIE[$userkey]: ""; + $pwdkey = sprintf ("%sauth", DBPREFIX); + $pwd = (isset($_COOKIE [$pwdkey]))? $_COOKIE[$pwdkey]: ""; $logged = ($connection->checkpwdmd5 ($user, $pwd)); ?> create_users_table (true); } catch (Exception $e) { diff --git a/inc/langutils.php b/inc/langutils.php index 8d458fa..758fef6 100644 --- a/inc/langutils.php +++ b/inc/langutils.php @@ -11,7 +11,9 @@ function ptrans ($str) { function trans ($str) { global $translations, $lang; - $res = $translations[$lang][$str]; + if (isset ($translations[$lang]) and isset($translations[$lang][$str])) { + $res = $translations[$lang][$str]; + } if (!isset ($res) || strlen ($res) == 0) { return $str; } else { @@ -36,7 +38,8 @@ function parse_accept_language () { if ($val > 1.0) { $val = 1.0; } - $possibilities [$matches [1]] = max ($val, $possibilities [$matches [1]]); + $ceil = (isset ($possibilities[$matches[1]]))? $possibilities[$matches[1]]: 0; + $possibilities [$matches [1]] = max ($val, $ceil); } } arsort ($possibilities); -- 2.39.5