Ignore:
Timestamp:
Sep 22, 2023, 11:55:38 PM (15 months ago)
Author:
chronos
Message:
  • Added: Store request URL into Log table.
  • Fixed: Some warnings for invalid inputs.
File:
1 edited

Legend:

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

    r955 r957  
    2424    {
    2525      $Category = $this->GetCategory();
    26       if (array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1;
     26      if (array_key_exists('id', $_GET) and is_integer($_GET['id'])) $Id = $_GET['id'] * 1;
    2727        else return $Output .= 'Položka nenalezena.';
    2828      $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` '.
     
    6767    if ($User->CheckPermission('News', 'Insert', 'Group', $Category['Id']))
    6868    {
    69       $this->System->PageHeaders[] = array($this, 'GetPageHeader');
     69      Core::Cast($this->System)->PageHeaders[] = array($this, 'GetPageHeader');
    7070      $Output = '<strong>Vložení nové aktuality:</strong><br />';
    7171      // TODO: Static reference to dynamic category item
     
    170170        if ($Row['Intranet'] == 1) $IntranetChecked = ' checked="1"';
    171171          else $IntranetChecked = 0;
    172         $this->System->PageHeaders[] = array($this, 'GetPageHeader');
     172          Core::Cast($this->System)->PageHeaders[] = array($this, 'GetPageHeader');
    173173        $Output .= '<strong>Editace aktuality v kategorii '.$Category['Caption'].':</strong><br />';
    174174        $Output .= '<form action="?action=update" method="post">'.
     
    296296  {
    297297    $Category = array('Id' => 1); // Default category
    298     if (array_key_exists('category', $_GET)) $Category['Id'] = $_GET['category'] * 1;
    299     if (array_key_exists('category', $_POST)) $Category['Id'] = $_POST['category'] * 1;
     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;
    300300    //if (is_null($Category)) throw new Exception('Kategorie neurčena');
    301301    else
     
    311311  {
    312312    $Output = '';
    313     if (array_key_exists('action',$_GET)) $Action = $_GET['action'];
     313    if (array_key_exists('action', $_GET)) $Action = $_GET['action'];
    314314      else $Action = '';
    315315    if ($Action == 'view') $Output .= $this->ShowView();
     
    361361        if (substr($Index, 0, 8) == 'category') $Select .= '-'.substr($Index, 8);
    362362      }
    363       $Select = $this->System->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1);
     363      $Select = Core::Cast($this->System)->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1);
    364364      $Output = 'Výsledný RSS kanál: <a href="'.$Select.'">'.$Select.'</a>';
    365365    } else
     
    412412      foreach ($Parts as $Part)
    413413      {
    414         $Where .= 'OR (`Category`='.($Part * 1).')';
     414        if (is_integer($Part)) $Where .= 'OR (`Category`='.($Part * 1).')';
    415415      }
    416416      $Where = substr($Where, 2);
     
    474474      $Items[] = array(
    475475        'Title' => $Categories[$Row['Category']].' - '.$Row['Title'],
    476         'Link' => 'https://'.$this->System->Config['Web']['Host'].'/aktuality/?category='.$Row['Category'],
     476        'Link' => 'https://'.Core::Cast($this->System)->Config['Web']['Host'].'/aktuality/?category='.$Row['Category'],
    477477        'Description' => $Row['Content'].' ('.$Author.')'.$EnclosuresText,
    478478        'Time' => $Row['UnixTime'],
     
    481481
    482482    $RSS = new RSS();
    483     $RSS->Title = $this->System->Config['Web']['Title'].' - Aktuality';
    484     $RSS->Link = 'https://'.$this->System->Config['Web']['Host'].'/';
    485     $RSS->Description = 'Aktuality '.$this->System->Config['Web']['Description'];
    486     $RSS->WebmasterEmail = $this->System->Config['Web']['AdminEmail'];
     483    $RSS->Title = Core::Cast($this->System)->Config['Web']['Title'].' - Aktuality';
     484    $RSS->Link = 'https://'.Core::Cast($this->System)->Config['Web']['Host'].'/';
     485    $RSS->Description = 'Aktuality '.Core::Cast($this->System)->Config['Web']['Description'];
     486    $RSS->WebmasterEmail = Core::Cast($this->System)->Config['Web']['AdminEmail'];
    487487    $RSS->Items = $Items;
    488488    return $RSS->Generate();
Note: See TracChangeset for help on using the changeset viewer.