Added position to equipment
This commit is contained in:
+9
-9
@@ -13,7 +13,7 @@
|
||||
function gpc_get_string(&$GPC, $varname, $maxlen = NULL, $default = NULL) {
|
||||
// TODO Parameter nullval: single value or array of values which considered as null
|
||||
// Default value for nullval is "-1"
|
||||
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
|
||||
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
|
||||
return $default;
|
||||
}
|
||||
$s = trim($GPC[$varname]);
|
||||
@@ -24,14 +24,14 @@ function gpc_get_string(&$GPC, $varname, $maxlen = NULL, $default = NULL) {
|
||||
}
|
||||
|
||||
function gpc_get_int(&$GPC, $varname, $default = NULL) {
|
||||
if (!isset($GPC[$varname])) {
|
||||
if (!isset($GPC[$varname]) || $GPC[$varname] === '') {
|
||||
return $default;
|
||||
}
|
||||
return (int)$GPC[$varname];
|
||||
}
|
||||
|
||||
function gpc_get_uint(&$GPC, $varname, $default = NULL) {
|
||||
if (!isset($GPC[$varname])) {
|
||||
if (!isset($GPC[$varname]) || $GPC[$varname] === '') {
|
||||
return $default;
|
||||
}
|
||||
$val = (int)$GPC[$varname];
|
||||
@@ -43,7 +43,7 @@ function gpc_get_uint(&$GPC, $varname, $default = NULL) {
|
||||
|
||||
function gpc_get_float(&$GPC, $varname, $default = NULL) {
|
||||
global $g_lconv;
|
||||
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
|
||||
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
|
||||
return $default;
|
||||
}
|
||||
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
|
||||
@@ -55,7 +55,7 @@ function gpc_get_float(&$GPC, $varname, $default = NULL) {
|
||||
|
||||
function gpc_get_currency(&$GPC, $varname, $default = NULL) {
|
||||
global $g_lconv;
|
||||
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
|
||||
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
|
||||
return $default;
|
||||
}
|
||||
$var = str_replace($g_lconv['thousands_sep'], '', $GPC[$varname]);
|
||||
@@ -132,21 +132,21 @@ function gpc_get_datetime(&$GPC, $varname, $default = NULL) {
|
||||
}
|
||||
|
||||
function gpc_get_color(&$GPC, $varname, $default = NULL) {
|
||||
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
|
||||
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
|
||||
return $default;
|
||||
}
|
||||
$color = $GPC[$varname];
|
||||
if ((strlen($color) == 7) and (substr($color, 0, 1) == '#')) {
|
||||
if ((strlen($color) == 7) && (substr($color, 0, 1) == '#')) {
|
||||
$color = substr($color, 1);
|
||||
}
|
||||
if ((strlen($color) != 6) or (! ctype_xdigit($color))) {
|
||||
if ((strlen($color) != 6) || (! ctype_xdigit($color))) {
|
||||
return $default;
|
||||
}
|
||||
return strtoupper($color);
|
||||
}
|
||||
|
||||
function gpc_get_enum(&$GPC, $varname, $values, $default = NULL) {
|
||||
if (!isset($GPC[$varname]) or (strlen(trim($GPC[$varname])) == 0)) {
|
||||
if (!isset($GPC[$varname]) || (strlen(trim($GPC[$varname])) == 0)) {
|
||||
return $default;
|
||||
}
|
||||
if (! in_array($GPC[$varname], $values)) {
|
||||
|
||||
Reference in New Issue
Block a user