Ignore:
Timestamp:
Sep 23, 2023, 12:04:04 AM (8 months ago)
Author:
chronos
Message:
  • Fixed: Numeric check for input values.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/News/NewsPage.php

    r957 r958  
    2424    {
    2525      $Category = $this->GetCategory();
    26       if (array_key_exists('id', $_GET) and is_integer($_GET['id'])) $Id = $_GET['id'] * 1;
     26      if (array_key_exists('id', $_GET) and is_numeric($_GET['id'])) $Id = $_GET['id'] * 1;
    2727        else return $Output .= 'Položka nenalezena.';
    2828      $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` '.
     
    296296  {
    297297    $Category = array('Id' => 1); // Default category
    298     if (array_key_exists('category', $_GET) and is_integer($_GET['category'])) $Category['Id'] = $_GET['category'] * 1;
    299     if (array_key_exists('category', $_POST) and is_integer($_POST['category'])) $Category['Id'] = $_POST['category'] * 1;
     298    if (array_key_exists('category', $_GET) and is_numeric($_GET['category'])) $Category['Id'] = $_GET['category'] * 1;
     299    if (array_key_exists('category', $_POST) and is_numeric($_POST['category'])) $Category['Id'] = $_POST['category'] * 1;
    300300    //if (is_null($Category)) throw new Exception('Kategorie neurčena');
    301301    else
     
    412412      foreach ($Parts as $Part)
    413413      {
    414         if (is_integer($Part)) $Where .= 'OR (`Category`='.($Part * 1).')';
     414        if (is_numeric($Part)) $Where .= 'OR (`Category`='.($Part * 1).')';
    415415      }
    416416      $Where = substr($Where, 2);
Note: See TracChangeset for help on using the changeset viewer.