catch negative ages

nix extra var
This commit is contained in:
Habeas Codice 2015-02-20 19:48:51 -08:00
parent 6b4d5eedc4
commit ffd47e6b95

View File

@ -2244,10 +2244,11 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = UPDATE_FLAGS_
dbesc($hash) dbesc($hash)
); );
$age = intval($arr['xprof_age']); if($arr['xprof_age'] > 150)
if($age > 150) $arr['xprof_age'] = 150;
$age = 150; if($arr['xprof_age'] < 0)
$arr['xprof_age'] = 0;
if($r) { if($r) {
$update = false; $update = false;
foreach($r[0] as $k => $v) { foreach($r[0] as $k => $v) {
@ -2276,7 +2277,7 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = UPDATE_FLAGS_
where xprof_hash = '%s'", where xprof_hash = '%s'",
dbesc($arr['xprof_desc']), dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']), dbesc($arr['xprof_dob']),
$age, intval($arr['xprof_age']),
dbesc($arr['xprof_gender']), dbesc($arr['xprof_gender']),
dbesc($arr['xprof_marital']), dbesc($arr['xprof_marital']),
dbesc($arr['xprof_sexual']), dbesc($arr['xprof_sexual']),
@ -2299,7 +2300,7 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = UPDATE_FLAGS_
dbesc($arr['xprof_hash']), dbesc($arr['xprof_hash']),
dbesc($arr['xprof_desc']), dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']), dbesc($arr['xprof_dob']),
$age, intval($arr['xprof_age']),
dbesc($arr['xprof_gender']), dbesc($arr['xprof_gender']),
dbesc($arr['xprof_marital']), dbesc($arr['xprof_marital']),
dbesc($arr['xprof_sexual']), dbesc($arr['xprof_sexual']),