summaryrefslogtreecommitdiff
path: root/www/functions/func_register.php
diff options
context:
space:
mode:
authorHorus32014-03-12 19:32:07 +0100
committerHorus32014-03-12 19:32:07 +0100
commit11f7f219b72c909cdbf74426e5095d9ee3ef8ec8 (patch)
treebd40b8407a63724cea45076aa161fb617dabe09d /www/functions/func_register.php
parent9a63d1abed608ecce689fa4e7409c498c8d827ff (diff)
downloadfiles.iamfabulous.de-11f7f219b72c909cdbf74426e5095d9ee3ef8ec8.tar.gz
fixed PHP's bug with empty()
Diffstat (limited to 'www/functions/func_register.php')
-rw-r--r--www/functions/func_register.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/www/functions/func_register.php b/www/functions/func_register.php
index 3fc9949..10f1d5d 100644
--- a/www/functions/func_register.php
+++ b/www/functions/func_register.php
@@ -10,14 +10,14 @@ function register($db){
/* checking for empty password etc. */
if(($cleartext_password != $second_password) || !isset($_POST["pswd"]) || !isset($_POST["2ndpswd"]) || $cleartext_password == "" || empty($_POST["pswd"]) || empty($_POST["2ndpswd"])){
- header("Refresh: 0; register?reason=password");
+ header("Refresh: 0; /register?reason=password");
return false;
}
/* TODO: allow full unicode */
if(preg_match("/[^-_0-9a-zA-Z]/", $name) || preg_match("/[^-_0-9a-zA-Z]/", $cleartext_password) || preg_match("/[^-_0-9a-zA-Z@.]/", $email)){
- header("Refresh: 0; register?reason=encoding");
+ header("Refresh: 0; /register?reason=encoding");
return false;
}
@@ -27,14 +27,14 @@ function register($db){
/*Checks the validation of the registration attempt*/
$test_status_db = $db->query("SELECT status FROM user WHERE email='" . $safe_email . "';");
- $test_status_arr = $test_status_db->fetchArray(SQLITE3_NUM);
- $test_status_int = $test_status_arr[0];
+ $test_status_ar = $test_status_db->fetchArray(SQLITE3_NUM);
+ $test_status_int = $test_status_ar[0];
$test_key_db = $db->query("SELECT key FROM user WHERE email='" . $safe_email . "';");
- $test_key_arr = $test_key_db->fetchArray(SQLITE3_NUM);
- $test_key = $test_key_arr[0];
+ $test_key_ar = $test_key_db->fetchArray(SQLITE3_NUM);
+ $test_key = $test_key_ar[0];
- if (empty($test_status_db) || $test_status_int != 0 || $test_key != $_POST["key"] || $test_key == ""){
+ if (empty($test_status_ar) || $test_status_int != 0 || $test_key != $_POST["key"] || $test_key == ""){
header("Refresh: 0; /register?reason=prohibited");
return false;
} else {