|
|
|
|
@ -296,7 +296,7 @@ final class safer_io { |
|
|
|
|
return $item; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static function find_post_field(string $input_field_name) { |
|
|
|
|
private static function find_post_field(string $input_field_name): mixed { |
|
|
|
|
$content_type = self::get_clean_server_var('CONTENT_TYPE'); |
|
|
|
|
if ($content_type === null) { |
|
|
|
|
return false; |
|
|
|
|
@ -315,6 +315,18 @@ final class safer_io { |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static function find_get_field(string $input_field_name): mixed { |
|
|
|
|
if (isset($_SERVER['QUERY_STRING'])) { |
|
|
|
|
$query = self::get_clean_server_var('QUERY_STRING'); |
|
|
|
|
$get = []; |
|
|
|
|
parse_str($query, $get); |
|
|
|
|
if (isset($get[$input_field_name])) { |
|
|
|
|
return $get[$input_field_name]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static function get_input_by_type( |
|
|
|
|
string $input_field_name, |
|
|
|
|
@ -336,9 +348,13 @@ final class safer_io { |
|
|
|
|
if ($is_set) { |
|
|
|
|
return filter_input(INPUT_POST, $input_field_name); |
|
|
|
|
} |
|
|
|
|
if (!filter_has_var(INPUT_GET, "debugging")) { |
|
|
|
|
if (!self::find_get_field("debugging")) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
$get_var = self::find_get_field($input_field_name); |
|
|
|
|
if ($get_var !== false) { |
|
|
|
|
return $get_var; |
|
|
|
|
} |
|
|
|
|
$is_get_set = filter_has_var(INPUT_GET, $input_field_name); |
|
|
|
|
if ($is_get_set) { |
|
|
|
|
return filter_input(INPUT_GET, $input_field_name); |
|
|
|
|
@ -352,6 +368,12 @@ final class safer_io { |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
if ($input_type === INPUTS::get) { |
|
|
|
|
$get_var = self::find_get_field($input_field_name); |
|
|
|
|
if ($get_var !== false) { |
|
|
|
|
return $get_var; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$resolve_input = $input_type->resolve(); |
|
|
|
|
$is_set = filter_has_var($resolve_input, $input_field_name); |
|
|
|
|
if ($is_set) { |
|
|
|
|
|