Changeset 958


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

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r957 r958  
    11<?php
    22
    3 $Revision = 957; // Subversion revision
     3$Revision = 958; // Subversion revision
    44$DatabaseRevision = 957; // SQL structure revision
    55$ReleaseTime = strtotime('2023-09-22');
  • trunk/Modules/Contract/Contract.php

    r951 r958  
    109109  function Show(): string
    110110  {
    111     if (array_key_exists('i', $_GET))
     111    if (array_key_exists('i', $_GET) and is_numeric($_GET['i']))
    112112    {
    113113      $Output = $this->GenerateContract(' AND (Id='.($_GET['i'] * 1).')');
  • trunk/Modules/File/File.php

    r912 r958  
    126126      return '';
    127127    }
    128     else if (array_key_exists('i', $_GET))
     128    else if (array_key_exists('i', $_GET) and is_numeric($_GET['i']))
    129129    {
    130130      $Id = $_GET['i'] * 1;
  • trunk/Modules/IS/IS.php

    r922 r958  
    4242    if (array_key_exists('menutype', $_COOKIE)) $MenuType = $_COOKIE['menutype'];
    4343      else $MenuType = 0;
    44     if (array_key_exists('menutype', $_GET)) $MenuType = $_GET['menutype'] * 1;
     44    if (array_key_exists('menutype', $_GET) and is_numeric($_GET['menutype'])) $MenuType = $_GET['menutype'] * 1;
    4545    setcookie('menutype', $MenuType, time() + 60 * 60 * 24 * 365);
    4646
  • trunk/Modules/Log/Log.php

    r957 r958  
    6161
    6262    $Items = array();
    63     if (array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"';
     63    if (array_key_exists('type', $_GET) and is_numeric($_GET['type'])) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"';
    6464      else $Where = '';
    6565    $sql = 'SELECT *, UNIX_TIMESTAMP(`Time`) AS `TimeCreate`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`Id` = `Log`.`User`) AS `UserName`, `Time` FROM `Log`'.
  • 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);
  • trunk/Modules/Notify/Notify.php

    r956 r958  
    204204    td { padding: 5px; }
    205205    </style>';
    206     if (!array_key_exists('i', $_GET)) return 'Položka nenalezena';   
     206    if (!array_key_exists('i', $_GET) or !is_numeric($_GET['i'])) return 'Položka nenalezena';   
    207207    $Id = $_GET['i'] * 1;
    208208    $DbResult = $this->Database->select('NotifyLog', 'Title,Content, UNIX_TIMESTAMP(`Time`) AS `Time`', 'Id='.$Id);
  • trunk/Packages/Common/Common.php

    r901 r958  
    8484
    8585    if (!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 0;
    86     if (array_key_exists('page', $_GET)) $_SESSION['Page'] = $_GET['page'] * 1;
     86    if (array_key_exists('page', $_GET) and is_numeric($_GET['page'])) $_SESSION['Page'] = $_GET['page'] * 1;
    8787    if ($_SESSION['Page'] < 0) $_SESSION['Page'] = 0;
    8888    if ($_SESSION['Page'] >= $PageCount) $_SESSION['Page'] = $PageCount - 1;
Note: See TracChangeset for help on using the changeset viewer.