From ad239ff694d58708cf1e42745c19b987f388f613 Mon Sep 17 00:00:00 2001 From: Lgnap Date: Tue, 23 Apr 2013 12:02:58 +0200 Subject: [PATCH 1/3] isset must be used before use a value into array --- include/common.php | 2 +- include/my_functions.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/common.php b/include/common.php index d7a9692..90f078c 100644 --- a/include/common.php +++ b/include/common.php @@ -2,7 +2,7 @@ umask(0007); -if ($_SERVER['PHP_AUTH_USER']) +if (isset($_SERVER['PHP_AUTH_USER'])) $PHPki_user = md5($_SERVER['PHP_AUTH_USER']); else $PHPki_user = md5('default'); diff --git a/include/my_functions.php b/include/my_functions.php index 138bc03..ee3f998 100644 --- a/include/my_functions.php +++ b/include/my_functions.php @@ -64,8 +64,8 @@ function upload($source, $destination, $content_type="application/octet-stream") function gpvar($v) { global $_GET, $_POST; $x = ""; - if ($_GET[$v]) $x = $_GET[$v]; - if ($_POST[$v]) $x = $_POST[$v]; + if (isset($_GET[$v])) $x = $_GET[$v]; + if (isset($_POST[$v])) $x = $_POST[$v]; if (get_magic_quotes_gpc()) $x = stripslashes($x); return $x; } From 63fd1c96d6f284abff140b0527694e8f7b47ada1 Mon Sep 17 00:00:00 2001 From: Lgnap Date: Tue, 23 Apr 2013 12:04:45 +0200 Subject: [PATCH 2/3] Contact or email you should choose. Advice over use of a single code --- setup.php-presetup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.php-presetup b/setup.php-presetup index b98b8b1..dfa845f 100644 --- a/setup.php-presetup +++ b/setup.php-presetup @@ -109,7 +109,7 @@ case 'validate': if ( $passwd and $passwd != $passwdv ) $er .= 'Password and password verification do not match.
'; - if ( $email && ! is_email($contact) ) + if ( $contact && ! is_email($contact) ) $er .= 'E-mail address ('. htvar($contact) . ') may be invalid.
'; if (strpos($store_dir,$_SERVER['DOCUMENT_ROOT']) === 0) @@ -739,7 +739,7 @@ E-mail: someone@somewhere.com &nbs Password *
This password will be used to protect your root certificate private - key. Do not lose or forget this password. + key.
Can't contain single quote ! Do not lose or forget this password.    Again From 1613ae811917ca9c0b5c88cd7dc2dd0472c6c0de Mon Sep 17 00:00:00 2001 From: Lgnap Date: Tue, 23 Apr 2013 12:29:46 +0200 Subject: [PATCH 3/3] a define must use quote --- Makefile | 2 +- config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 38dc8d2..e280a81 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ distclean: clean echo -e '' > ca/index.php echo ' config.php - echo 'define(PHPKI_VERSION, "$(VERSION)");' >> config.php + echo 'define("PHPKI_VERSION", "$(VERSION)");' >> config.php echo '?>' >> config.php rm -f index.php setup.php diff --git a/config.php b/config.php index 188ac19..e89a276 100644 --- a/config.php +++ b/config.php @@ -1,3 +1,3 @@