Plugin Directory

Changeset 2831451


Ignore:
Timestamp:
12/10/2022 06:12:47 AM (3 years ago)
Author:
falcon13
Message:

Validation_helper->get_request_int update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • business-listing/trunk/helpers/validation_helper.php

    r2831421 r2831451  
    3232 */
    3333function otgblist_get_request_int ($field, $default=null) {
    34     if (empty($_REQUEST[$field]) || (!ctype_digit(trim($_REQUEST[$field])) && !is_int(trim($_REQUEST[$field])))) {
     34    $value = trim($_REQUEST[$field]);
     35    if (!ctype_digit($value) && !is_int($value)) {
    3536        if (is_int($default) || ctype_digit($default))
    3637            $out = $default;
     
    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.