Plugin Directory

Changeset 2831460


Ignore:
Timestamp:
12/10/2022 07:15:35 AM (3 years ago)
Author:
falcon13
Message:

Validation Helper->get_request_int fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kofc-state/trunk/helpers/validation_helper.php

    r2831418 r2831460  
    3232 */
    3333function otgkofcs_get_request_int ($field, $default=null) {
    34     if (empty($_REQUEST[$field]) || (!ctype_digit(trim($_REQUEST[$field])) && !is_int(trim($_REQUEST[$field])))) {
    35         if (is_int($default) || ctype_digit($default))
     34    $value = trim($_REQUEST[$field]);
     35    if (!is_numeric($value) && !is_int($value)) {
     36        if (is_int($default) || is_numeric($default))
    3637            $out = $default;
    3738        else
    3839            $out = null;
    3940    } else {
    40         $out = (int)trim($_REQUEST[$field]);
     41        $out = (int)$value;
    4142    }
    4243    return $out;
Note: See TracChangeset for help on using the changeset viewer.